GNU Screen is great utility with a number of helpful features. Maybe there is no UNIX / (GNU / Linux), admin which doesn't use screen or some similar terminal emulator prog. daily basis.
Little might know however abut a kewl functionality allowing, a few logged in users via ssh to share one terminal.
Sharing a virtual terminal with another person, is very helpful if you want to teach someone a bit of Linux / UNIX basics, showing him how certain commands works on a system etc. etc.
Shared terminal session is very helpful in case of need for remote system administration or support, whether instead of explaining someone over the phone for 20 minutes or an hour a bunch of commands he has to run to achieve something, you can login share terminal with screen and do whatever necessary in front of his eyes.
Shared screen session, can actually in theory allow unlimited people to watch what a certain one is doing in a his virtual terminal. This is very helpful for example in Computer Laboratories for Teachers to teach students FreeBSD, Linux, bash, csh shell scripting, perl or whatever programming language taught.
Allowing two or more logged in users with same user credentialsto use screen can be done pretty easy, one primary user (creating the initial screen terminal session), should just launch GNU screen:
The second, third, 4th, 5th and the rest of users should login via SSH session with same user, lets say test and launch screen -x
test@noah:~$ screen -list
There is a screen on:
20147.pts-5.noah ( 1.11.2012 18,27,50) (Attached)
1 Socket in /var/run/screen/S-hipo.
test@noah:~$ screen -x
I'm not sure if screen has some kind of limitation on how many users maximum can connect to a screen session, but I guess it should be high enough for dozen of people – at least 512 or 1024 people to connect and share one shell simultaneously.
In some Linux distributions (versions) RHEL, CentOS it is possible screen -x not to work out of the box, because screen binary is not set to be SUID.
On latest Debian versions and deb derivatives thanksfully, screen bin is by default installed as SUID so screen -x works fine.
hipo@noah:~$ ls -al /usr/bin/screen
-rwxr-sr-x 1 root utmp 364088 29 ÑŽÐ»Ð¸ 2009 /usr/bin/screen
Enabling mutiuser screen login via a running screen session is possible by pressing:
CTRL + a + : and typing in prompt multiuser on
In case you want to have a system user which by default allows a multiple logged in users to share shell you can use a little 'hack' just change in /etc/passwd the field recordfor user shell (/bin/bash) with (/usr/bin/screen)
Lets say you want to allow the user test support multiple logged in users share one shell the record for test in /etc/passwd should look smth. like:
Change it with your favourite text editor to:
If you have some problems running screen, check permissions and eventually exec as superuser:
chmod u+s /usr/bin/screen