Linux: SSH Command Cheat Sheet

# Connect to host as your local username

ssh host

# Connect to host as user

ssh user@host

# Connect to host using port

ssh -p port user@host

# Generating public-private keys

ssh-keygen

# Create a key pair

ssh-keygen -t rsa

# Copy Public SSH Key

ssh-copy-id hostname_or_IP

# Edit SSH Config File

sudo vim /etc/ssh/sshd_config

# Restart SSH service

sudo ssh service restart

Leave a Reply

Your email address will not be published. Required fields are marked *