Using SSH-Agent With Screen

Carl’s excellent post describes how to set up Screen with ssh-agent so that when a new screen session is started, windows with names were set up and logged onto different servers automatically. It was not clear how to create the configuration file .screenrc_escP to me initially, but after a bit of trying the following steps worked:

  • open ~/.screenrc_escP in vi
  • type string “escape”
  • press tab key
  • press ctrl-v: holding the control key press the v key
  • press ctrl-p: holding the control key press the p key
  • type character p

In my terminal window character ctrl-p is in bold:

Screen Configuration File

The escape sequence for the outer screen is ctrl-p instead of ctrl-a– to see the windows created in the outer screen type ctrl-p + ” — holding the control key press p, release the control key, press double quotes:

Screen Wrapper
Escape Sequence for Outer Screen is ctrl-p and Nested Screen is ctrl-a

I use ctrl-p at bash prompt to go to the previous command, so I chose ctrl-y as my escape character for the outer screen. After setting up config files and ssh-agent, starting a screen session created different windows and ssh connections opened to different servers.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s