Remote Computing Quick Reference

Remote Access: SSH, SCP, Rsync, RDP & WireGuard

Control servers from anywhere, copy files without losing data, and wrap traffic inside encrypted tunnels. Every command below is copy-ready and works across Linux, macOS, and Windows PowerShell.

โฑ๏ธ 8 min ref๐ŸŸข Beginner Friendly๐Ÿ“… Updated: 2026

Command Anatomy: How an SSH Command Reads

Standard SSH Login
ssh -i ~/.ssh/id_ed25519 -p 22 user@host
Tool ssh Open encrypted shell
Identity Key -i ~/.ssh/id_ed25519 Your private key file
Port -p 22 Server door (default 22)
Destination user@host Account + IP/domain
PUBLIC INTERNET (UNTRUSTED) ๐Ÿ”’ ENCRYPTED TUNNEL SSH (TCP 22) or WireGuard (UDP 51820) ๐Ÿ’ป Your Laptop id_ed25519 Private key stays here ๐Ÿ›ก๏ธ Bastion Host ssh -J bastion Public entry gate ๐Ÿ–ฅ๏ธ App Server 10.0.1.25 No public IP
Traffic is scrambled end-to-end across the public internet; the Bastion forwards you safely to private internal servers.

1 SSH & Key Management

Passwords can be guessed by bots. SSH keys work like a padlock (.pub public key you put on servers) and a physical key (private key that never leaves your laptop).

ssh-keygen -t ed25519 -C "you@laptop"
Generate a Modern Keypair Creates id_ed25519 (private) and id_ed25519.pub (public). Faster and stronger than RSA.
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host
Install Public Key on Server Appends your .pub key to the server's ~/.ssh/authorized_keys for passwordless login.
ssh -L 8080:localhost:5432 user@host
Local Port Forward (SSH Tunnel) Maps your laptop's port 8080 securely to port 5432 (e.g., Postgres) inside the remote server.
ssh -J bastion_user@bastion [email protected]
Jump / Bastion Host Hops through a public Bastion server to reach a private server that has no public IP.
๐Ÿง  Memory Trick: -L means Local first: ssh -L local_port:target_host:target_port user@ssh_server. You open localhost:local_port on your own machine.

Shortcut Aliases with ~/.ssh/config

Save long flags once so you can just type ssh prod-db.

~/.ssh/config
Host bastion
    HostName 203.0.113.10
    User ops
    IdentityFile ~/.ssh/id_ed25519

Host prod-app
    HostName 10.0.1.25
    User deploy
    ProxyJump bastion
    IdentityFile ~/.ssh/id_ed25519

2 Secure File Transfer (SCP, Rsync, SFTP)

All three transfer files over encrypted SSH (port 22). Use SCP for quick one-offs, Rsync for large folders/backups, and SFTP for interactive browsing.

scp ./app.tar.gz user@host:/opt/
SCP Upload (Local โ†’ Remote) Copies a single file to the remote /opt/ folder. Add -r for directories, -P 2222 (uppercase P!) for custom ports.
scp user@host:/var/log/app.log ./
SCP Download (Remote โ†’ Local) Pulls a remote file straight into your current local folder (./).
rsync -avz --progress ./site/ user@host:/var/www/
Rsync Smart Sync -a archive (keeps permissions), -v verbose, -z compress. Only sends changed blocks and resumes if dropped.
sftp user@host
SFTP Interactive Session Opens a prompt where you type ls, cd, get file (download), or put file (upload).
๐Ÿง  Memory Trick (Trailing Slash in Rsync): ./site/ (with slash) copies the contents inside /var/www/. ./site (no slash) creates /var/www/site/.

3 Remote Protocols Quick Table

Know which port and transport each remote tool usesโ€”especially when configuring firewalls or security groups.

Protocol Default Port Encrypted? Best For
SSH 22 / TCP Yes (Strong) Linux/macOS/Windows CLI administration & port tunneling
SFTP 22 / TCP Yes (Over SSH) Interactive encrypted file browsing and transfers
RDP 3389 / TCP & UDP Yes (TLS) Windows full graphical desktop (always put behind VPN!)
VNC 5900 / TCP No by default Cross-platform screen sharing (tunnel over SSH or VPN)
WireGuard 51820 / UDP Yes (ChaCha20) Modern, ultra-fast kernel VPN tunnels & site-to-site links
OpenVPN 1194 / UDP (or 443/TCP) Yes (TLS) Legacy enterprise VPNs; TCP 443 bypasses strict firewalls

4 WireGuard & VPN Quick Reference

A VPN creates an encrypted private network overlay so you can reach internal servers (like 10.0.1.25 or RDP 3389) without exposing them to the public internet.

sudo wg-quick up wg0
Start WireGuard Tunnel Brings up the interface defined in /etc/wireguard/wg0.conf. Use down to disconnect.
sudo wg show
Check Tunnel Status Shows peer public keys, endpoint IP, latest handshake time, and bytes sent/received.

Full Tunnel vs. Split Tunnel (AllowedIPs)

Full Tunnel 0.0.0.0/0

Routes 100% of your internet traffic through the VPN server.

Best for untrusted public Wi-Fi (cafes, airports) where you want all browsing encrypted.

Split Tunnel 10.0.0.0/8

Routes only private office/cloud subnets through the VPN; normal web browsing stays direct.

Best for daily DevOps workโ€”fast video calls while still reaching private servers.

5 The Danger Zone

โš ๏ธ Common Mistakes That Get Servers Hacked (or Lock You Out)
1. Exposing RDP (Port 3389) Directly to the Internet

Automated bots scan port 3389 24/7 for brute-force and ransomware attacks. Never open 3389 to 0.0.0.0/0โ€”always connect through a WireGuard/OpenVPN tunnel + MFA first.

2. Sharing or Committing Private Keys (id_ed25519)

Only ever share the .pub file! Never paste id_ed25519 into Git, Slack, or email. If leaked, delete it from every server's authorized_keys immediately.

3. Running chmod 777 ~/.ssh Breaks SSH

SSH refuses to use keys if other users on the system can read them ("Permissions are too open"). Fix it with: chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_ed25519.