Add a new user account
Create a new user
To add a user, run the command:
useradd -m yourusername
-moption tells the useradd command to create a home directory for your user if it doesn't already exist.
Make a password
Making a password for your your user is identical to how we created a password in root. just type in:
Follow throught the prompts after that to successfully create a password for your main user.
Installing the sudo command
sudo command allows you to manipulate and edit files in the root directory without actually logging in as root. It can also assist you in running commands that is usually not accessible to a normal user.
To install the sudo command, run:
Congratualtions! But installing sudo by itself ins't gonna do you any good. We must give our user access to it.
pacman -S sudo
Adding groups to your users
Add users to their required groups
There are a number of groups we must add for our user, some of the important groups are
storage, and of course
wheel group is how we get access to the sudo command. So without adding it, the previous steps would be pointless. To add users to groups, run the command:
Some other groups you might be interested in are:
usermod -aG wheel,audio,video,optical,storage yourusername
To enable the sudo command, go to your terminal and type in
visudo, The default editor for this file will be
vi so if you don't want to use that type in:
After that, using your text editor (in this case
nano), navigate through the blocks of texts and uncomment (remove the hashtags) the follwing line:
%wheel ALL=(ALL) ALL
Save and exit.
And you're done! You've added a user and gave it access to the
sudocommand. Now everytime you try and type in something that could potentially mess up your system,
sudowill ask for the password of your root user. Basically saying, "do you really want to do that?". Just remember, the next time you fuck up, it's 100% your fault :)