screen makes a command line session that you can detach from while your apps are still running and come back to later.
...and...you can attach from multiple places at once, share your session, have multiple sub screens, flip between them, split the view between them, get notifications of activity (or lack thereof) on hidden ones... theres way too much built into this...
most commands begin with control-a and a letter. for example help is C-a ?. to send C-a to a program your running inside screen, C-a a.
| new named session | screen -S name |
| list sessions | screen -ls |
| detach | C-a d |
| (re)attach | screen -r |
| attach while attached | screen -x |
| detach other session | screen -d |
screen -x leaves other sessions attached, making multiple windows to the same thing. if you want to detach them use screen -d from outside the screen session or screen -dr to attach while detaching the others.
names for screen sessions are for attaching/detaching when you have more than one. if you didnt name it, you can use the number from screen -ls
| copy mode (scrolling) | C-a [ |
| mark text | space |
| paste | C-a ] |
copy mode is mostly used to see the text that scrolled past. you can use arrow keys or vi keys (i,j,k,l) to move around. copy mode ends when you press space the second time or hit esc.
a screen session can have multiple "windows" for multitasking. example, work in one, nethack in another etc...
| new window | C-a c |
| switch windows | C-a 0-9 |
| rename window | C-a A |
| list windows | C-a " |
screen has a command line, C-a :, which works like the one in mutt or vi. heres and example of what you can do with it
set up a host so they can just telnet in and watch the show. the screen binary itself will need to be setuid for this to work, so be carefull with it.
/usr/local/bin/loginvoyeur #!/bin/rbash login voyer /usr/local/bin/voyeurshell #!/bin/rbash screen -x exhibitionist/shared /etc/inetd.conf telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd -L /usr/local/bin/loginvoyeur /etc/passwd voyer::1001:100:,,,:/home/voyer:/usr/local/bin/voyeurshell
then, as exhibitionist, do the following in the screen command line, to add the voyeur, only allow them watch, then let them in
acladd voyeur chacl * -wx "#?" multiuser on