Terminal – How to Lock Command Line

screen-lockterminal

For example, in X session, I can use CtrlAltL to lock the screen, so it would ask for password to unlock and prevent somebody from messing with mine computer.

But if I have an open terminal session on one of the tty's (which I can access with CtrlAltF1, for example) – then it is not locked, and somebody can still use it to do some harm. Is there a way to 'lock' that command line (with some background processes running in it, maybe)?

Best Answer

vlock will do as you ask. However, if you want to run background processes, consider screen instead, which will let you also log off and keep processes running in the background, and then reattach -- even when logged in from alternate places.

Related Question