After building a Linux server for the first time by signing up for a VPS (Virtual Private Server) or setting up a server on an old PC at home, many beginners are confused, wondering, “What should I do first?” In order to operate the server safely and comfortably, we will introduce the initial settings that must be performed immediately after installing the OS and the required commands for that purpose.
1. Package update
First and foremost, keep your systems up to date to close known vulnerabilities. If you are using Ubuntu or Debian, run the following command.
sudo apt update (update package list)
sudo apt upgrade (update installed packages)
2. Creating and granting privileges to general users
Performing daily tasks as a “root” user with powerful privileges that can do anything is extremely dangerous from the standpoint of operational errors and security. Create a general user for work, and use the “sudo” command to exercise administrator privileges only when necessary.
adduser [username] (Create a new user)
gpasswd -a [username] sudo (add to sudo group)
3. Enhanced security for SSH connections
Review the “SSH” settings for remotely controlling the server from outside. Edit the configuration file (/etc/ssh/sshd_config) and take the following measures.
・Changing the default port number (22)
・Prohibition of direct login as root user (PermitRootLogin no)
・Disable password authentication (allow only key authentication method)
After changing the settings, restart the service with sudo systemctl restart ssh.
4. Firewall settings Set up a firewall (UFW, etc.) to block unnecessary communications. Set the port for SSH and, if you want to publish the web server, to only allow HTTP(80) / HTTPS(443).
These initial settings are the basics of server operation. Let’s carefully proceed with the settings one by one while understanding the meaning of the commands.

