First steps on a new Linux VPS: SSH, updates, user and keys
A fresh VPS is only as safe as the first ten minutes you spend on it. This checklist uses Ubuntu or Debian style commands. They can differ on other distributions, so verify them for yours.
1. Log in with SSH
Use the IP address and login details from your order. From a terminal on Windows, macOS or Linux:
- ssh root@YOUR_SERVER_IP
- Type yes to accept the host fingerprint the first time
- Enter the password you were given
2. Update packages
- apt update
- apt upgrade -y
- reboot if the kernel was updated
3. Create a non-root user
Working as root all day is risky, so make a normal user with sudo rights.
- adduser deploy
- usermod -aG sudo deploy
- su - deploy and test sudo whoami, which should print root
4. Set up SSH keys
Do this on your own computer, not the server.
- ssh-keygen -t ed25519
- ssh-copy-id deploy@YOUR_SERVER_IP
- ssh deploy@YOUR_SERVER_IP and confirm you get in without a password
If ssh-copy-id is not available, paste the contents of your .pub file into ~/.ssh/authorized_keys on the server.
5. Check the basics
- hostnamectl shows the system name and OS
- timedatectl shows the time zone, and sudo timedatectl set-timezone Asia/Kolkata changes it
- free -h and df -h show memory and disk
Common mistakes
- Closing your only root session before testing the new user
- Pasting a private key instead of the public one
- Wrong permissions on ~/.ssh, fixed with chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys
What next
Once keys work, move on to our guide on securing a VPS, where you turn on a firewall, add fail2ban and disable password login.
If you get stuck, send a ticket on our Discord or email support and we will help you get connected.