SSH - Remote Access in Linux

From the Linux Essential Commands cheat sheet · Networking · verified Jul 2026

SSH - Remote Access

Securely connect to remote servers

bash
# Connect to server
ssh username@hostname

# Connect with port
ssh -p 2222 username@hostname

# Execute command
ssh username@hostname 'ls -la'

# SSH with key
ssh -i ~/.ssh/key.pem username@hostname
✅ Secure encrypted connection to remote machines
💡 -i specifies private key file for authentication
🔍 Store keys in ~/.ssh/ directory (chmod 600)
networksshremotesecurity

More Linux tasks

Back to the full Linux Essential Commands cheat sheet