Skip to content

Instantly share code, notes, and snippets.

@danhodge
Last active November 6, 2019 21:54
Show Gist options
  • Save danhodge/141f6a994438ff7e2929e4f50f261879 to your computer and use it in GitHub Desktop.
Save danhodge/141f6a994438ff7e2929e4f50f261879 to your computer and use it in GitHub Desktop.
SSH notes
Establish a local SSH tunnel to a remote server
$ ssh -f <user>@<ip> -L <local_port>:<ip>:<remote_port> -N
Generate a SSH public/private key pair (4096 bits, with no comment at the end of the public key)
$ ssh-keygen -b 4096 -C ""
Extract the public key from a private key
$ openssl rsa -in private_key.pem -pubout # PEM formatted
$ ssh-keygen -y -f private_key.pem # SSH formatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment