User Management in Linux Ubuntu 16.04 System. How to create a new user in Ubuntu, using Terminal. How to add users on Ubuntu 16.04 and how to delete users on Ubuntu 16.04. Adding and deleting users on Ubuntu, via terminal commands.
Adding and Deleting Users in Ubuntu 16.04
Add a New Ubuntu User
Ubuntu users can add a new user using “adduser” command. When you run the “adduser” command to add a user account, you will have to give the new user account a password and name.
sudo adduser username
You can also create a new user using the System Settings. Open System Settings and click on User Accounts. From here you can easily manage new Ubuntu user. Please note that you must have root privilege to add or delete a new user.
Once the user is created, you can easily use the newly created user account. Please note that when a new user is created, the adduser utility creates a new home directory named /home/username.
Delete a Ubuntu User
If you wish to delete the newly created user, use the command “deluser” to remove and delete the specific Ubuntu user:
sudo deluser username
Please note that when you delete a specific user account, it does not remove their respective home folder. You can delete the folder manually.
Change User Permissions
You can easily change and grant permissions for a specific user – change UID/GID values. Run the following command as required:
sudo chown -R root:root /home/username/
sudo mkdir /home/archived_users/
sudo mv /home/username /home/archived_users/
Not only this, you can also temporarily lock or unlock a specific user account using the following command:
sudo passwd -l username
sudo passwd -u username