tunneling_with_dreamcompute
This is an old revision of the document!
Tunneling with DreamCompute
These steps set up remote access to a home network using an ssh tunnel to a DreamCompute host.
- At the DreamCompute Security Groups and Key Pairs panels…
- Create a new Security Group ruleset. Add rules to open the desired ports, including port 22 for ssh. For example, to open port 22 use parameters: Custom TCP Rule, Ingress, Port 22, Remote CIDR = 0.0.0.0/0.
- Create a Key Pair, download the public key (e.g.,
cloud.pem
), and put it in the home server~/.ssh
directory.
- At the DreamCompute Instances panel, launch a new instance (Boot Source Image Ubuntu 16.04, Flavor gp1.subsonic), selecting the newly created Security Group and Key Pair.
- Create an A-type DNS record for the DreamCompute IP address with a name like
casa.example.com
. - Using ssh from home machine, connect to Dreamhost instance (e.g.,
ssh -i .ssh/cloud.pem ubuntu@casa.example.com
). Edit/etc/ssh/sshd_config
and add this configuration information at the end (assuming default user isubuntu
):ClientAliveInterval 30 ClientAliveCountMax 3 Match User ubuntu GatewayPorts yes
This step also ensures that the Dreamhost instance is added to the local
~/.ssh/known_hosts
file. - While connected to the Dreamhost instance, do
sudo apt-get
andupdate
,upgrade
,dist-upgrade
, andautoremove
. And, reboot. - On home server, create a
~/.ssh/config
file with something like this…Host tunnel HostName casa.example.com User ubuntu IdentityFile ~/.ssh/cloud.pem BatchMode yes EscapeChar none RemoteForward *:9190 192.168.1.190:2190 RemoteForward *:9191 192.168.1.191:2191 RemoteForward *:9999 192.168.1.192:2222
- Add this line to crontab:
@reboot autossh -fN tunnel
References
tunneling_with_dreamcompute.1560552679.txt.gz · Last modified: 2019/06/14 15:51 by jtkorb