DEV Community

Mark Nefedov
Mark Nefedov

Posted on

Setup screen session for interviewee monitoring

This tutorial provides a step-by-step guide on setting up a shared screen session for a Linux interview. By following these steps, you can give the interviewee access to a Linux box while monitoring their inputs. Although the steps are mostly similar for all Linux distributions, minor adjustments may be required for different shells.

Step 1: Create a User for the Interviewee

First, create a new user account for the interviewee using the useradd command. The -m flag creates a home directory for the new user.

useradd -m interviewee
Enter fullscreen mode Exit fullscreen mode

Step 2: Install the screen Utility

The screen utility allows you to create and manage multiple terminal sessions. If it's not already installed on your system, use the appropriate package manager command for your Linux distribution:

  • For SUSE:
zypper in screen
Enter fullscreen mode Exit fullscreen mode
  • For Debian/Ubuntu:
apt install screen
Enter fullscreen mode Exit fullscreen mode
  • For RHEL/Fedora:
dnf install screen
Enter fullscreen mode Exit fullscreen mode

Step 3: Modify the .profile File to Create a screen Session at User Login

Next, update the .profile file in the interviewee's home directory to automatically create a screen session when they log in. Use the echo command to append the necessary line to the file:

echo "screen -S interviewee-session" >> /home/interviewee/.profile
Enter fullscreen mode Exit fullscreen mode

Make sure to replace /home/interviewee with the actual path to the interviewee's home directory if it's different on your system.

Step 4: Access the Shared Screen Session

Now you can give the interviewee their credentials, and they can log in to the system. To monitor their actions, switch to the user account you created and access the shared screen session using the following command:

screen -x interviewee-session
Enter fullscreen mode Exit fullscreen mode

That's it! You've successfully set up a shared screen session for a Linux interview.

Top comments (0)