Creating a user in Ubuntu is very simple and easy by just following few of the instructions. SSH into your Ubuntu instance or open terminal to proceed.
- Create a new user Account
Create a new user account using the
usernamewith the user name that you want to create:
Adding user `username' ... Adding new group `username' (1001) ... Adding new user `username' (1001) with group `username' ... Creating home directory `/home/username' ... Copying files from `/etc/skel' ... New password: Retype new password: passwd: password updated successfully
2. Add user to the sudo group
usermod -aG sudo username
3. Switch to new user
su - username
Run the whoami command to check
You have learned to create a user with sudo privileges. You can now log in to Ubuntu server with this user account and use
sudo to run administrative commands.
That’s all! Feel free to leave a comment if you have any questions.