Note: You may not need to do this step depending on how your server was provisioned/setup.
Most (all?) setups of Linux I’ve seen in the last decade ask you to configure a non-root user as part of the installation – so even if your server is being provisioned by a 3rd party NOC team in a datacenter, my expectation is that you’ll still end up with a non-root user.
On most modern Linux systems you can do a quick and dirty check to see if non-root users are created on your install by typing:
sudo ls /home
/home
is the default location on Debian, Ubuntu, Fedora, etc. for user accounts to be created under – it is certainly possible to create user accounts elsewhere so if this directory is empty, you can verify there are no user accounts by doing the following:
sudo cat /etc/passwd
… and then looking through the output (sometimes quite long) and confirming that there are no new user accounts with different home directories mapped to them.
Tip: Many of the accounts in passwd
are created by the system on initial install – any user accounts that have been created will be near the bottom of this file, especially in a few system.
Once you have confirmed there is no, non-root account, you can add a new one using the simple command:
sudo adduser frank
Where “frank” would be replaced with the username you wanted to create.
Be sure to set a strong password for this account and then you can move on!