What To Do After Your First VPS Connection (Recommended Setup Guide)

Once you have successfully connected to your VPS using SSH, your server is accessible but not yet secure or production-ready.
This article explains exactly what to do next, step by step, in the correct order.

Prerequisites

root@your-server-name:~#

STEP 1: Update the Server (VERY IMPORTANT)

Updating the server ensures:

Run:

apt update && apt upgrade -y

This may take a few minutes.

STEP 2: Create a New User (More Secure Than Root)

Using root for daily work is not recommended.

Create a new user

adduser deploy

You will be asked to:

Give the user sudo access

usermod -aG sudo deploy

Now deploy can run admin commands safely.

STEP 3: Add SSH Key for the New User (IMPORTANT)

Switch to the new user:

su - deploy

Create SSH folder:

mkdir ~/.ssh
chmod 700 ~/.ssh

Copy SSH key from root user:

cp /root/.ssh/authorized_keys ~/.ssh/
chmod 600 ~/.ssh/authorized_keys

Exit back to root:

exit

STEP 4: Disable Root Login (Optional but BEST PRACTICE)

This step greatly improves security.

Open SSH config:

nano /etc/ssh/sshd_config

Change or set these values:

PermitRootLogin no
PasswordAuthentication no

Save:

Restart SSH service:

systemctl restart ssh

⚠️ Do NOT close your SSH session yet
First, test login with the new user.

STEP 5: Test Login with New User

From your PC terminal:

ssh deploy@YOUR_SERVER_IP

Example:

ssh [email protected]

If login works ✅
You can safely stop using root.

Best Practices Summary

Task

How Often

SSH key generation

Once

Add SSH key to VPS

Once

Server updates

Weekly

SSH login

Daily

VPS web console

Emergency only

Root login

Disabled

Final Daily Command You’ll Use

ssh deploy@YOUR_SERVER_IP

(Not root, for better security)

After this, you may also:

Conclusion

After your first VPS connection:

  1. Update the server

  2. Create a non-root user

  3. Secure SSH access

  4. Disable root login

  5. Use SSH normally every day

Your VPS is now secure, stable, and production-ready