Using Screen to Manage Multiple Displays in one SSH Session

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Screen is very useful to help you administer server via SSH or console. It allows multiple shell session to be controlled by single SSH session.

As server administrator, Screen usually being used to:

  • Create multiple windows with each of the window is running different command
  • Create 2 windows. One window managing local server, another one is managing other remote server
  • Share window with other user remotely. They can see what you type and run in the shell via SSH

Lets install Screen first via SSH (in this example I will use Putty) and I will show you on how to use and take advantages by having this application installed:

RedHat/CentOS/Fedora:

yum install screen -y

Ubuntu/Debian:

apt-get install screen

FreeBSD:

cd /usr/ports/sysutils/screen
make
make install clean

notes: (on FreeBSD, they might have some prompt, just accept the default value)

Installation done. I will show some example so you can follow and understand on how we should use Screen:

1. Type following command to start screen:

[[email protected] ~]# screen

2. You have enter first window of your screen. Run following command:

3. Now, press ‘Ctrl-A-C’ in the keyboard. This will create another window next to it. Run following command afterwards:

[[email protected] ~]# netstat -na

4. Now, press another ‘Ctrl-A-C’ in the keyboard. This will create another windows next to 2nd window (the netstat window). Run following command:

Continue reading “Using Screen to Manage Multiple Displays in one SSH Session” »