I have set a password for screen sessions in my .screenrc. It works great, any time I need to re-attach to a screen session I need to enter the password. There is another feature where you can lockout the current terminal (ctrl+a, x). This is a fantastic feature for locking the terminal really quickly, and I also have it automatically lock the terminal after 20 minutes idle time. For that in .screenrc I added the line 'idle 1200 lockscreen'.

My problem however is that once the terminal is in the lockscreen state, no password seems able to unlock it. Not the screen password, not my users login password. I have no idea where to set the password for this lockscreen state and nothing in the manpage or anything I've found online seems to think mentioning it would be important. The manpage says it uses either /usr/bin/lck or /usr/bin/lock or 'a builtin', but I have neither of the first two binaries and have no idea what this builtin is. Any help?

  • Probably belongs on SuperUser – dsolimano Aug 12 '10 at 16:37

screen uses PAM for authentication, so the password checking is configured in /etc/pam.d/screen.

This is the default configuration, which checks the Unix password database (/etc/passwd + /etc/shadow):

auth    required    pam_unix.so

If your system uses something else for authentication (Kerberos, NIS, ...) you have to update screen's PAM configuration too. (On some Linux distros (such as Debian), includeing /etc/pam.d/common-auth should be enough.)

  • I'm running debian squeeze. There was no /etc/pam.d/screen so I made one with the lines you recommended, it did not work. I tried copying the sshd file to screen, that didn't work either. There is also /etc/pam.d/other which supposedly catches anything not explicitly defined and runs it through all the common-* files. Obviously that hasn't worked either. I only use PAM for auth, so... dunno. I did however read elsewhere that screens builtin does use OS authentication (in my case PAM), so this is probably the right track. Just two cents short... – bawkstoo Aug 12 '10 at 20:30
  • 1
    Many months later, I upgraded the kernel of this computer and rebooted it. Screens terminal locking feature now works perfectly. I assume this is due to having upgraded many packages including pam over the years of uptime and only now being able to apply certain changes that required a reboot. (Only now do I realize you're probably the same grawity who has helped me many times in ##linux as well heh. Thanks again for the answer, you rock). – bawkstoo Dec 13 '10 at 17:55

As per the manual, you can configure a lock program of your liking by assigning it to the environment variable LOCKPRG before starting screen.

For how to cope with a locked terminal which you don't have a password for, see also https://superuser.com/questions/343965/what-is-the-default-password-of-screen/

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.