Beginner+⏱ 35 min

SSH Connection & Basic Commands

Learn how to securely connect via SSH, set up key-based authentication, and master essential daily commands.

What Is SSH?

SSH (Secure Shell) is an encrypted network protocol for securely accessing remote servers. It uses TCP port 22 by default and encrypts all transmitted data.

Connecting to Your VPS

Password Login

ssh root@your_server_ip # First connection will ask to confirm the fingerprint — type 'yes' # Then enter your password (characters won't show — that's normal)

Key-Based Authentication (Recommended)

Step 1: Generate a key pair

# Run on your local machine (Windows/macOS/Linux) ssh-keygen -t ed25519 -C "[email protected]" # Press Enter for default path, optionally set a passphrase

Step 2: Copy your public key to the server

ssh-copy-id -i ~/.ssh/id_ed25519.pub root@your_server_ip # Or manually append the public key to ~/.ssh/authorized_keys

Step 3: Verify passwordless login

ssh root@your_server_ip # If no password is required, key auth is working

Essential Command Reference

Files & Directories

CommandDescription
ls -laList all files including hidden ones
cd /path/to/dirChange directory
mkdir -p dir1/dir2Create directories recursively
cp -r source destCopy files/directories recursively
mv old newMove or rename
rm -rf dirForce delete recursively (use with caution)
find / -name "*.log"Search files globally

System & Processes

CommandDescription
top / htopReal-time CPU and memory usage
df -hDisk usage overview
free -hMemory usage overview
ps auxList all running processes
systemctl status nginxCheck service status
uname -aDisplay kernel version
uptimeSystem uptime and load averages

File Transfer

SCP (Secure Copy)

# Upload a file scp local_file.txt root@server_ip:/root/ # Download a file scp root@server_ip:/root/remote_file.txt ./ # Upload a directory scp -r local_dir root@server_ip:/root/

rsync (Incremental Sync)

# Sync local directory to server (only transfers changed files) rsync -avz ./local_dir/ root@server_ip:/remote_dir/
← Previous: First PurchaseNext: Choosing a Linux Distro →

VPS Rankings focuses on VPS selection, bringing together provider reviews, rankings, practical tutorials, performance benchmarks, and deal roundups. Complete your entire journey — from research and comparison to purchase — in one place. Whether you need budget web hosting, overseas cloud servers, or want to compare specs, routing, and pricing across providers, we make the decision easier. We also maintain long-term coverage of CN2 GIA, low-latency Asia routes, and other optimized solutions tailored for China-facing networks and cross-border businesses, and continuously update VPS recommendations, hands-on guides, and deal collections to help you make faster, more informed choices.