Skip to content

Instantly share code, notes, and snippets.

@djblue
Last active August 29, 2015 14:06
Show Gist options
  • Save djblue/491f4f84ef9075e2bca7 to your computer and use it in GitHub Desktop.
Save djblue/491f4f84ef9075e2bca7 to your computer and use it in GitHub Desktop.
reverse ssh is awesome

reverse ssh

Setup a reverse ssh tunnel to a remote machine:

ssh -fN -R 2222:localhost:22 user@server

Connect to tunnel after logging on to the remote machine:

ssh user@server
ssh user@localhost -p 2222

Easily generate keys to provide passwordless access:

ssh-keygen -t rsa -b 2048
ssh-copy-id user@server

Easily change hostname on ubuntu:

sudo hostname your-new-name

Easily change your default shell:

chsh

Example ssh config to help alias connections:

# ~/.ssh/config
Host dev
	HostName dev.example.com
	Port 22000
	User fooey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment