When setting up a new server, there are some basic initial steps that you should take to secure and configure the system. In this article, we will guide you through the process of initial server setup with Ubuntu 20.04.
Before we begin, make sure that you have a fresh installation of Ubuntu 20.04 and that you are logged in as a user with sudo
privileges.
Create a new user
The first step in the initial server setup is to create a new user for yourself. It is not recommended to use the “root” user for daily tasks, as it has full access to the system and can potentially cause harm if used incorrectly.
To create a new user, run the following command in the terminal:
sudo adduser username
Replace "username"
with the actual username that you want to use. This will create a new user with the specified username and prompt you to set a password for the user.
Grant the new user sudo privileges
After creating the new user, we need to grant it sudo
privileges so that it can perform administrative tasks on the system. To do this, run the following command in the terminal:
sudo usermod -aG sudo username
Replace “username” with the actual username of the user that you want to grant sudo
privileges to. This will add the user to the “sudo” group, which allows it to perform administrative tasks on the system.
Enable the firewall
The next step in the initial server setup is to enable the firewall on the system. Ubuntu 20.04 comes with the “ufw” firewall installed by default, so we can use it to enable the firewall.
To enable the firewall, run the following command in the terminal:
sudo ufw enable
This will enable the firewall and allow all incoming traffic. You can also configure the firewall to allow only specific ports or services.
Install security updates
It is important to keep your system up to date with the latest security patches and updates. To do this, run the following command in the terminal to install the available security updates:
sudo apt update
sudo apt upgrade
This will update the package index and install the available security updates on your system.
By following these steps, you should have successfully completed the initial server setup with Ubuntu 20.04. You can now use your new user account to perform daily tasks on the server and continue configuring it to meet your specific needs.