Password protect GNU screen sessions

Or, How do i get a crypted password for .screenrc ?

Here is a quick tip, hopefully it helps someone, I struggled with this for some time...

I have been using GNU screen program since a long time. This program is like a window manager for terminals and is especially useful for ISP and home shell accounts. You can have multiple shells running under the same session and can easily detach the sessions and reattach them from a different computer later etc.

I usually password protect my sessions by using the password command (ctrl A :password). But I had a hard time figuring out how to set that password in .screenrc file. The file obviously does not store it in plaintext and uses a crypted version of password. To get the crypted password, simply set your password in the screen session (ctrl A :password and then enter the password twice), then the crypted version gets automatically saved to screen's copy buffer! All you need to do is have a line in your .screenrc which looks like this
password DTWxS2voQWkgI

After this all your new screen sessions will be automatically password protected (meaning you will need the password to reattach a session.)

3 thoughts on “Password protect GNU screen sessions

  1. This doesn’t seem to work… I can set a password with :password, and it says the password is in copybuffer, but the copybuffer isn’t actually updated. This is both on Ubuntu 11.10 and Cygwin.

    1. Strage! It should not depend on the system you are on as screen maintains its own copybuffer. Unless you have remapped the keys, you should be able to paste it anywhere by using ‘CTRL A ]’ key combination.

Leave a Reply