Is there a way to give the root user a temporary password? That is, after a certain time, or after it is manually deactivated, the password will be deleted.
I want to give my colleague permission to access a server as root for a certain amount of time (like a day) so he can use ssh [email protected]
. After that, the password I give him will expire, and attempts to use it to log in will be rejected.
Is there a way to do this?
Try
passwd -x 1
. Fromman passwd
:This does not, of course, prevent your colleage from setting a password of their own choice, or using SSH keys to login.
You could also try
usermod -e
. Fromman usermod
:All of this is moot since you are giving the root password. The colleague can always undo whatever measure you put up.
It would be best if you give the user exactly as much privilege as they require, using
sudo
.