my question is how to best manage two layers of "screen" sessions:

In my institute we have a compute cluster for numerical simulation. To login on that cluster one has to go via a load balancer who distributes the users to 4 control nodes (from where they then can start jobs on the actual cluster and do post-processing) because the login process is a little complex (3 passwords ad a user interaction) I would like to keep one session open, which I can also resume from home. This implies running screen on my workstation. On the other hand I would like to have multiple screens on the control node using only one ssh connection, so I have to run screen also on the node. But if I do that I can only control the first screen (by "crtl+a" and "space" for example). What would be the best solution to this using only one ssh connection? Thanks for your help!


  • Well, you can use ctrl+a+a to send a ctrl+a through the first screen to the second, but hopefully someone would have a better solution for you – Eric Renouf Jan 13 '16 at 17:19
  • thanks for the tip Eric! this is a quick and easy trick. – pmgast Jan 16 '16 at 17:03

On your workstation, you can change the escape character to something other than ctrl+a, maybe ctrl-b. To do this, add this line to your .screenrc file:

escape ^Bb

This way you can reconnect to the screen session on your workstation and use ctrl-a as the escape character to send command to the screen session running on your control node while using ctrl-b for the session on your workstation.


You asked two questions:

  • multiple screens

In addition to changing the escape character as mentioned by others, you could look at tmux, which is very much like screen, only better. Biggest bonus is that you can have multiple clients connected simultaneously, so you can leave the one on your workstation up while you connect from home too.

  • only one ssh connection

given that you want both control from your workstation and have to log in to the cluster, I don't see how that is possible.

  • thanks for the tip with tmux. If it is easy to compile I will try that. – pmgast Jan 16 '16 at 17:07
  • You can leave a screen session open and connect to it from multiple locations too – Eric Renouf Jan 17 '16 at 1:32
  • @EricRenouf - true, but I believe that tmux is easier in this regard. YMMV. – crimson-egret Jan 19 '16 at 23:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.