screen

From Initq
Jump to: navigation, search


Contents

Start Screen

  • screen -q

Name the session

  • screen -S sessionname

Open New Screen

  • “Ctrl-A” “c”

Toggle bwteen screens

  • To get to Next, use “Ctrl-A “n”
  • To get to Back, use “Ctrl-A “Backspace”
  • Go directly to your screen Ctrl-A (0-9)

Leaving a screen

  • “Ctrl-A” “K” or “exit”

Screen Logging

  • “Ctrl-A” “H”

Detach a screen

  • “Ctrl-A” “D”

Admin a screen session

  • Start screen with screen -S my_screen_name
  • ssh into the same machine as same user, screen -x my_screen_name

Admin a screen multiuser

1. The host starts screen in a local xterm, using the command screen -S SessionName. The -S switch gives the session a name, which makes multiple screen sessions easier to manage. Code:

  • screen -S screen-test

2. The remote user (bjones) uses SSH to connect to the host computer (jsmith). Code:

  • ssh bjones@jsmith.computer.ip.address

3. The host (jsmith) then has to allow multiuser access in the screen session via the command CTRL-A :multiuser on (all 'screen' commands start with the screen escape sequence, CTRL-A). Code:

CTRL-A
:multiuser on

4. Next, the host (jsmith) must grant permission to the remote user (bjones) to access the screen session using the commadn CTRL-A :acladd user_name where user_name is the remote user's login ID. Code:

CTRL-A
:acladd bjones

5. The remote user can now connect to the hosts 'screen' session. The syntax to connect to another user's screen session is screen -x host_username/sessionname. Code:

  • screen -x jsmith/screen-test

Split Screen

  • Ctrl-a S
  • Ctrl-a TAB (switch between users.

Then you will have to create a session with Ctrl-a c.

Lock one Screen

  • Ctrl-a s (suspend)
  • Ctrl-a q (unlock)

Screen Script

root@wifi:~# less .screenrc
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
 
# Default screens
screen -t shell1 0
screen -t shell2 1
screen -t shell3 2
screen -t shell4 3
screen -t shell5 4
screen -t Irc 5
screen -t Roundup 6
Personal tools