home ¦ Archives ¦ Atom ¦ RSS

GNU Screen Locking Fix

Since I started using an iPad Pro cover, SSH, and screen, this problem has been biting me in the rear:

I have been using GNU Screen for a while now. I usually create multiple new windows (Ctrl-a c) every day. Then I flip back and forth between the multiple screens (Ctrl-a n) or just toggle between the last 2 windows used (Ctrl-a a). Sometimes my finger slips and I hit Ctrl-a x which provides you with a password prompt. This is GNU Screen’s lockscreen function.

Normally you just enter your user password and the screen will unlock. Screen is using /local/bin/lck or /usr/bin/lock by default. This is all fine and dandy if you have a user account password to enter. If you have servers that only use SSH keys and don’t use passwords you will have no valid password to enter. In other words you are stuck at this lock screen. One way around it is to login to the same machine and re-attach to the same screen session (normally “screen -r” if you have only 1 session open). Then kill the session with the lock screen. This is annoying to have to do.

It really is a pain, but it has an extremely simple solution. Basically you disable the default binding for locking and go on about your business.

© 2008 ‐ 2023 C. Ross Jam. Built using Pelican. Theme based upon Giulio Fidente’s original svbhack, and slightly modified by crossjam.