Linux Server Install: Part 3
Create a New Account and add it to the sudoers list, bruh.
Previous
Add Users
Let’s add a morty!
To add a new user named “morty” on an Ubuntu server, you can use the following steps:
sudo adduser morty
You will be prompted to enter and confirm a password for the user. Choose a secure password and enter it twice at the prompts.
You will also be prompted to enter additional information about the user, such as their full name and contact details. This information is optional, so you can simply press Enter to skip each prompt if you do not want to provide it.
Once the user has been added, you can use the usermod
command to add the user to any additional groups or to modify their other settings, if needed. For example, to add the user to the sudo
group, you would run the following command:
sudo usermod -aG sudo morty
Finally, you can verify that the user has been added by running the id
command and specifying the username:
id morty
This should show you the user’s UID, GID, and any groups that the user belongs to.
Verify morty
has sudo privileges:
sudo -lU morty
Now let’s disable logins for the root
account:
sudo passwd -l root