Top 30 SSH shenanigans

Good list of commands to be SSH 'Yoda'. I like the tunnels and screen the most in these. They have been so useful over the years, for development and troubleshooting.

SSH Shenanigans

Here is a short list that I use ofter:

 1# Copy SSH public key
 2$ ssh-copy-id user@host
 3
 4# Alternative for ssh-copy-id
 5$ cat ~/.ssh/id_rsa.pub | ssh user@machine “mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys”
 6# Start a tunnel local:2001 -> remote:80
 7$ ssh -N -L2001:localhost:80 somemachine
 8
 9# Run a GUI app from remote machine
10$ ssh -fX <user>@<host> <program>
11
12# SSH to machien behind NAT
13$ ssh -NR 0.0.0.0:2222:127.0.0.1:22 user@jump.host.com

Click to Original Post

comments powered by Disqus