In part 3 of this series I will be following the arch wiki general recommendations section to complete some initial setup tasks on my newly installed Arch operating system.
The first thing that I need to do is setup a new user account so I am not always logged in as root. I just issue the following command to create a user account and set its password.
useradd kevin -m -s /bin/bash passwd kevin
The -m option sets up a home folder for the new user and the -s option sets the default shell for the user. This is a basic user account that does not have full rights to the system. Logging in with this user is more secure than root. Sometimes I will need to run administrative commands with my new account so I need to install the sudo package.
Arch uses pacman as it’s package manager. This manager can be used to download, install, and update official arch software packages. I want to download the sudo package however I find that right now I am not able to connect to the internet. I head over to the networking section of the arch wiki.
The wiki tells me to check the status of my network cards by using the ip link command.
I notice a couple of things. First the network adapter names are not what I’m used to seeing in Linux. Second my network adapter status is showing “state DOWN”. I read this article which explains the reasoning behind changing the old standard for naming network adapters. It seems to make sense and I often run into trouble when adding and removing network adapters to my kali VM so I will live without the “predictable network interface names”. I’m never going to remember the name “enp0s3” so I opt to rename my device manually. The wiki directs me to create a file called “/etc/udev/rules.d/10-network.rules”. In the file I can specify my network adapters mac address and a new name. They recomend not using the traditional ethX naming convention and say I should use netX instead. I create the file and reboot. My network adapter now shows as a much easier to remember “net0”
I will hopefully be using this OS to do some hacking challenges which might require me to change my mac address at some point. I’ll need to remember to spoof the mac instead of actually changing it, or add another network adapter, or else this might come back to confuse me later. In any case I have a renamed network adapter but it’s still down. I start the dhcpcd service to bring my net0 adapter ip and obtain an IP address from my DHCP server. Now I’m able to ping the internet and get online.
Back to the task at hand I need to install the sudo package to I run the command “pacman -S sudo”.
Now that sudo is installed I grant my new user account sudoer rights. To edit the sudo file you must use the visudo tool. I use the tool and un-comment a line to enable all members of the wheel group sudo rights.
Now I add my new user to the wheel group using the command “usermod -aG wheel kevin”. To test this I logout of root and login with my new account. I use the command whoami to print the current user. Then I run whoami again using sudo to show my privileges being escalated.
Now going forward I can use this new account for everything. If I need to do something that requires root permissions I can just use sudo.
The wiki recommends some basic system maintenance. I create a very simple script that I can run from time to time to run their recommended commands.
That’s all for now. In the next part I plan on starting to setup a GUI environment to make my Arch OS look a little better.