Articles‎ > ‎

Adding and Deleting Users in Ubuntu Server or Desktop in Command Line

Add User

To add a user account, use the following syntax
sudo adduser username

Delete User

To delete a user account and its primary group,Syntax
sudo deluser username

To temporarily lock or unlock a user account

 use the following syntax,

lock User

sudo passwd -l username

unlock User

sudo passwd -u username

Add Group

To add a personalized group, use the following syntax
sudo addgroup groupnam

Delete Group

To add a personalized group, use the following syntax
sudo delgroup groupname

Add User to Group

To add a user to a group, use the following syntax:\
sudo adduser username groupname