First steps after your Linux VPS is ready (SSH, updates, firewall)

Log in over SSH, change the root password, install updates, add a sudo user and switch on a firewall without locking yourself out.

  • Beginner
  • Linux VPS
  • 2 min read

By RunRacks Team · Published

A new Linux VPS gives you full root access and a clean operating system. Spend ten minutes on these first steps and your server will be up to date, easier to manage and much harder to break into.

1. Log in over SSH

Find your server's IP address and root password in the client area under Services. Then open a terminal. On Windows 10 and 11 you can use PowerShell or Windows Terminal, because the OpenSSH client is built in.

Terminal
ssh [email protected]

The first time, SSH asks you to confirm the server's fingerprint. Type yes and press Enter, then paste the password. Nothing appears on screen while you type the password. That is normal.

2. Change the root password

Set a long, unique password that only you know:

Terminal
passwd

3. Install updates

Fresh images are rarely fully up to date. Use the command for your distribution.

Debian and Ubuntu:

Terminal
apt update && apt upgrade -y

AlmaLinux, Rocky Linux and other RHEL-based systems:

Terminal
dnf upgrade -y

If a new kernel was installed, reboot so it takes effect:

Terminal
reboot

4. Create a normal user with sudo

Working as root all the time makes mistakes more costly. Create your own user and give it admin rights.

Debian and Ubuntu:

Terminal
adduser alex
usermod -aG sudo alex

RHEL-based systems:

Terminal
adduser alex
passwd alex
usermod -aG wheel alex

Open a second terminal and check that ssh [email protected] works and that sudo whoami prints root.

5. Turn on a firewall

Allow SSH before you enable the firewall, or you will lock yourself out.

On Ubuntu and Debian with UFW:

Terminal
apt install -y ufw
ufw allow OpenSSH
ufw enable
ufw status

On RHEL-based systems with firewalld:

Terminal
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload

Open more ports only when you need them, for example ufw allow 80,443/tcp for a website.

6. Set the time zone

Correct times make logs much easier to read:

Terminal
timedatectl set-timezone Europe/London
timedatectl

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Getting started

Edit files with nano: a beginner's guide

Open, edit, search and save files with the nano text editor on a Linux server, including cutting and pasting lines, showing line numbers and safely editing system config files with sudo.

  • Beginner
  • Linux VPS
  • 5 min read

Getting started

Your first hour with a new RunRacks server

A step-by-step roadmap for the first hour after your RunRacks server is delivered, from finding your login details to changing the password, updating the OS and picking your next guides.

  • Beginner
  • All
  • 5 min read

Getting started

How to choose a server location

Pick a data center location based on where your users, broker or team are, confirm it with ping tests, and weigh the legal and latency points that come with each choice.

  • Beginner
  • All
  • 4 min read