SSH - Remote Access in Linux

From the Linux Commands cheat sheet · Networking · verified Nov 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
🔍 Keep keys in ~/.ssh/; private key files need chmod 600
networksshremotesecurity

Continue with Linux Commands

Save the full cheat sheet or work through every related task.

More Linux tasks

Back to the full Linux Commands cheat sheet