Share your love
Best Initial Server Setup with Ubuntu 20.04

In this article, we will teach you the initial server setup with Ubuntu 20.04. The important point about this article is that, before starting with Ubuntu 20.04, you need to make some basic settings for its preparation and security, which are fully mentioned in this article.
You can now proceed to the following steps provided by the Orcacore team to complete the Initial Server Setup with Ubuntu 20.04.
Table of Contents
Initial Server Setup with Ubuntu 20.04 For Beginners
First, we want to start with root login, then, create a sudo user, and set up a basic firewall. Let’s start with how we can do it.
Step 1 – Root login on Ubuntu 20.04
If you aren’t connected to your server, log in as the root.
Note: If you use Linux based system for connecting to the Ubuntu server use the following command, on the other hand, if you use Windows, use software like Putty, then, enter the following command:
ssh root@SERVER_IP_ADDRESS
Also, if it is your first time logging into the server, you should change the root password with a strong password.
Tips: To get more information about Putty, you can check this guide on Using Putty on Windows.
Step 2 – Create a new user on Ubuntu 20.04
You can add a user on Ubuntu 20.04 with the following adduser command:
Note: In the following example, a username called Orca will be created. You can enter a name you like to use.
adduser orca
It will ask you for a password, choose a strong password for your new user.
Root privileges for new users on Ubuntu
If a user wants to access the root privileges for the initial server setup on Ubuntu 20.04, the user should join the “sudo” group. Only sudoers have to access the root privileges.
To add your new user to the “sudo” group, you can run the following command:
usermod -aG sudo orca
Now your user has to access the root privileges by using “sudo” before each command.
Step 3 – Setup a basic firewall on Ubuntu 20.04
For Initial Server Setup with Ubuntu 20.04, you need to set up a basic firewall. The default firewall configuration tool for Ubuntu is UFW.
It must be installed on your server by default. If it is not installed, you can install UFW on Ubuntu 20.04 with the command below:
apt install ufw -y
You can use the following command to see available applications in your output:
ufw app list
Then, you need to allow openSSH traffic by using the following command:
ufw allow openSSH
After that, you must enable the firewall by running the command below:
ufw enable
Enter ‘y’ to complete the process.
Now you can check your UFW status that is active and running with the following command:
ufw status
At this point, you can SSH to your new account. Open a new terminal and run the following command:
ssh username@your_server_ip
Then enter your user password to log in.
If you want to use root privileges as we mentioned before, you should use sudo before each command.
sudo command-to-run
Note: If the root account uses SSH key authentication you need to add a copy of your local public key to the new user’s ~/.ssh/authorized_keys file to log in successfully. The simple way is to use the Rsync command:
rsync --archive --chown=username:username ~/.ssh /home/username
Now SSH to your new user without using a password:
ssh username@your_server_ip
Remember you need a user password for each time you use sudo for your command.
Note: if you don’t have an SSH key you can easily create a new one by visiting this article about How to generate SSH key pairs in Linux.
Conclusion
At this point, you have learned the Initial Server Setup with Ubuntu 20.04. As you must know, the basic setup of a server is an essential task that every user must know. You can easily create your first sudo user and set up the basic firewall settings to start doing your configurations, etc.
I hope you enjoy this article about Initial Server Setup with Ubuntu 20.04.
Also, you may like to read the following articles:
Upgrade Linux Kernel to the Latest on Ubuntu 20.04