Add a new user account
Create a new user
To add a user, run the command:
useradd -m yourusername
The -m
option 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:
passwd yourusername
Follow throught the prompts after that to successfully create a password for your main user.
Installing the sudo command
What is
sudo
?- Installing
sudo
The 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:
pacman -S sudo
Congratualtions! But installing sudo by itself ins't gonna do you any good. We must give our user access to it.
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 audio
, video
, storage
, and of course wheel
. The 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:
usermod -aG wheel,audio,video,optical,storage yourusername
Some other groups you might be interested in are: kvm
, scanner
, floppy
, disk
, input
etc.
Enable the sudo
command
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:
EDITOR=nano visudo
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
sudo
command. Now everytime you try and type in something that could potentially mess up your system, sudo
will 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 :)