Note: This procedure can be used in any Linux distro to add a normal user. That includes ubuntu, Linux mint, or even Centos
Here’s how you will create a normal user:
- Open a terminal and issue the following command.
1#useradd -m <username>-m
creates a home directory for the user.
- Now we have to set a password for the user.
It will ask you to create a new password.
- At this point, we have a new user account.
But we might want to add our new user to the „sudoers“ group, so that we can use „sudo“ to do administrative actions.
1#usermod -a -G sudo <username>
The option -a means to add and -G sudo means to add the user to the sudo group. If you want to know more about the usermod command, issue #man usermod command to know more about usermod
- Now we have to specify the shell for our new user.
1#chsh -s /bin/bash <username>
chsh command is used to change the login shell for a user.
- All done.! you are all set. You could logout and login to your new account.