# usermod -s /sbin/nologin UserLoginName
To unlock the user account
# usermod -s /bin/bash UserLoginName
Alternatively, you can use the commands to lock the user account
# passwd -l UserLoginName
To unlock the user account
# passwd -u UserLoginName
Linux Toolkits Blog is a scratch-pad of tips and findings on Linux
# usermod -s /sbin/nologin UserLoginName
# usermod -s /bin/bash UserLoginName
# passwd -l UserLoginName
# passwd -u UserLoginName
No comments:
Post a Comment