It has happened to me on numerous occasions that I am working on a terminal of my laptop and at that precise moment they request me in another office, or I have 'something' doing in a terminal and for convenience or necessity I must let a friend of mine use it for a few minutes my laptop, in cases like this ... How do I protect what I do in the terminal without having to completely block the user session?
Fortunately the package exists: vlock
Install this package on your system and then just run it in a terminal (
vlock), they will see that the terminal was blocked / protected and until they press [Enter] and enter the password, this will continue 😉
If you want to see the log referring to failed attempts, successful login attempts and more, you just have to do a cat to the /var/log/auth.log file passing it as a parameter to grep "Vlock"
cat /var/log/auth.log | grep "vlock"
This is a simple tip yes, but it has already been useful to me ... I hope you too 😀