Created
February 12, 2014 13:40
-
-
Save orendon/8955738 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Accessing my home machine from outside world | |
| # on AWS | |
| sudo vim /etc/ssh/sshd_config | |
| GatewayPorts yes | |
| sudo /etc/init.d/ssh restart | |
| # check connections from outside (open port 7000 if needed) | |
| netstat -ntl | |
| # locally | |
| ssh -i myfile.pem -R 7000:localhost:22 root@ec2-xxx-xxx.compute-1.amazonaws.com | |
| # extras, skip password prompt and reconnect automatically | |
| cat ~/.ssh/id_rsa.pub | ssh root@ec2-xxx-xxx.compute-1.amazonaws.com 'cat >> .ssh/authorized_keys' | |
| autossh -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -i myfile.pem.pem -R 7000:localhost:22 root@ec2-xxx-xxx.compute-1.amazonaws.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment