Lock it up

This is a quite useful tool. Let’s assume you are working with colleagues on a system on their desktop. They are working on their shells as unprivileged users, however you need to help with you slightly differently privileged account from time to time. Of course you can’t really leave your shell open to their disposal. But you don’t want to log out and in every time because you prepared your environment to do this work, so how do you lock your colleagues out of your shell? Well, in Solaris 11.4 there is now a lock tool. It looks your shell and you can only unlock it with the users password. In the case you have a root shell by su, it will ask for the password of the user that went into this root shell.

jmoekamp@solaris:/usr/lib/sstore/metadata/json-schema$ su - root
Password:
You have new mail.
root@solaris:~# lock
Unlock user jmoekamp on /dev/pts/2
Password:
root@solaris:~#