Cheatpapper


# SSH Basics

ssh user@host ssh -p 2222 user@host ssh -i keyfile user@host

# Authorized keys on remote server

~/.ssh/authorized_keys

# Upload

scp file user@host:/tmp/ rsync -azvP -e "ssh" file user@host:/tmp/

# Use specific cipher

ssh -c aes256-gcm@openssh.com user@host

# Proxy

ssh -J user@proxyhost user@target

# Run commands

ssh user@host ls -la ssh user@host "sudo systemctl restart httpd" ssh user@host 'sudo lsof -Pni'

# Options

# -o lets you pass any SSH client configuration option directly on the command line. # It’s the same as putting the option inside ~/.ssh/config, but used ad-hoc. ssh -o Option1=value -o Option2=value user@host