Wiki‎ > ‎

Adduser vs Useradd (Debian/Ubuntu)

posted Feb 23, 2016, 8:27 AM by Dong Xu   [ updated Jun 25, 2016, 5:03 PM ]
Should use adduser which is a perl script that calls useradd and has enhanced features:

Lock a Password

To disable / lock the password of user account use below command. This will not disallow ssh-access on Ubuntu. This prepends a ! to the password hash so that no password will match it anymore.

# take away peters password
sudo passwd -l peter

To unlock him:

# give peter back his password
sudo passwd -u peter