First Things to Do After Connecting — Initial Server Setup

The 10-minute checklist after your first SSH connection. Update the system, create a non-root user, set a hostname. These steps prepare your server for everything in Part 3 — and skipping them makes later work harder.

Terminal showing system update running — dnf update output scrolling with package names

You’re connected. The server is running. The temptation is to start installing things immediately.

Don’t. Four quick steps first — they take 10 minutes and make everything after them cleaner and safer.


Step 1 — Update the System

A fresh VPS ships with the OS as it was when the image was created — which could be weeks or months ago. Packages have been updated since then, including security patches.

Rocky Linux:

sudo dnf update -y

Ubuntu:

sudo apt update && sudo apt upgrade -y

The -y flag automatically answers yes to all prompts. This takes 1–5 minutes depending on how many packages need updating.

Terminal showing dnf update output — package names scrolling, 'Complete!' at the bottom
dnf update on Rocky Linux. The 'Complete!' at the bottom confirms everything updated successfully.

Reboot if the kernel updated:

sudo reboot

Check if a kernel update was included — look for lines containing kernel in the update output. If the kernel updated, reboot applies it. The server comes back in about 60 seconds.

# Reconnect after reboot
ssh root@your-server-ip

Step 2 — Create a Non-Root User

Working as root is convenient and dangerous. Root has unrestricted access to everything. A typo in a command, a compromised session, or an accidentally run script has full system consequences.

Create a regular user and give it sudo access instead:

# Create user — replace 'steven' with your preferred username
useradd -m -s /bin/bash steven

# Set a password
passwd steven

# Add to wheel group (sudo access on Rocky Linux)
usermod -aG wheel steven

Verify the user was created:

id steven
# Output: uid=1000(steven) gid=1000(steven) groups=1000(steven),10(wheel)

The wheel group in the output confirms sudo access.


Step 3 — Copy Your SSH Key to the New User

Your SSH key is currently in /root/.ssh/authorized_keys. The new user needs their own copy.

# Create the .ssh directory for the new user
mkdir -p /home/steven/.ssh

# Copy the authorized_keys file
cp /root/.ssh/authorized_keys /home/steven/.ssh/authorized_keys

# Set correct ownership and permissions
chown -R steven:steven /home/steven/.ssh
chmod 700 /home/steven/.ssh
chmod 600 /home/steven/.ssh/authorized_keys

Step 4 — Test Login as New User

Before closing your root session, open a new terminal window and test:

ssh steven@your-server-ip

You should connect without a password prompt (using your SSH key). Once connected, test sudo:

sudo dnf update
# Should ask for your user password and then work
Two terminal windows side by side — left shows root session still open, right shows successful login as new user steven
Keep root open while testing the new user. Both windows open simultaneously is the safe approach.

Step 5 — Set a Hostname

The default Vultr hostname is a random string like vps-abc123-def456. Change it to something meaningful:

sudo hostnamectl set-hostname vps-main

Update /etc/hosts to match:

sudo nano /etc/hosts

Find the line with the old hostname and update it:

127.0.1.1   vps-main

Save (Ctrl+O, Enter, Ctrl+X) and verify:

hostname
# Output: vps-main

The new hostname appears in your terminal prompt after you reconnect:

[steven@vps-main ~]$

When you have multiple servers, a meaningful hostname makes it immediately obvious which one you’re on.


The Completed Checklist

Before moving to Part 3, confirm:

  • System packages updated (dnf update completed)
  • Non-root user created with sudo access
  • SSH key copied to new user’s authorized_keys
  • New user SSH login tested and working
  • Hostname set to something meaningful

If all five are checked, Part 3 — server security — starts from a clean, current foundation.


Part 2 Complete

Part 2 covered everything from choosing a provider to being logged into a properly set up server. You’ve gone from a blank Vultr account to a running Rocky Linux VPS with a non-root user, updated packages, and SSH key authentication.

Part 3 locks down the server before you install anything else — SSH port change, firewall, Fail2ban, and disabling root password login entirely. The failed login attempts you may have already seen in your auth log are the reason Part 3 comes before anything else.

Frequently Asked Questions

Why shouldn't I use root for everything?
Root has unrestricted access — any command you run as root executes with full system privileges. A typo or a compromised session as root has far worse consequences than as a regular user. Using sudo on a regular user account means every privileged action requires deliberate intent.
What if I forget the password for my new user?
As long as your SSH key is configured for the new user, you can still connect and reset the password with sudo passwd username. If you lose both the user password and SSH access, you'll need Vultr's web console to recover.
Do I need to reboot after updating the system?
Sometimes. If the kernel was updated (you'll see kernel packages in the update list), a reboot applies the new kernel. Run: sudo reboot. The server comes back up in about 60 seconds and you reconnect via SSH.
What should I name my server?
Something short and memorable that identifies the server's purpose or location. Examples: vps-main, web-sg-01, vultr-wordpress. Avoid spaces. The hostname appears in your terminal prompt, making it easier to know which server you're on when managing multiple.