Tunneling with DreamCompute
These steps set up remote access to a home network using an ssh tunnel to a DreamCompute host.
- Create a new Security Group ruleset. Add rules to open the desired ports, including port 22 for ssh and some random port (say, 1234) for remote access to the home server. 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 private key (e.g.,
cloud.pem), and put it in the home server
- 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. (Alternative: Use duckdns.org to create a public domain name.)
- Using ssh from home machine, connect to Dreamhost instance (e.g.,
ssh -i .ssh/cloud.pem email@example.com). Edit
/etc/ssh/sshd_configand add this configuration information at the end (assuming default user is
ClientAliveInterval 30 ClientAliveCountMax 3 Match User ubuntu GatewayPorts yes
This step also ensures that the Dreamhost instance is added to the local
- While connected to the Dreamhost instance, do
autoremove. And, reboot.
- On home server, create a
~/.ssh/configfile with something like this (assuming home server has local IP address 192.168.1.192 and is listening on ssh port 1234)…
Host tunnel HostName casa.example.com User ubuntu IdentityFile ~/.ssh/cloud.pem BatchMode yes EscapeChar none RemoteForward *:1234 192.168.1.192:1234
- Add this line to crontab:
@reboot autossh -fN tunnel
- From laptop (or other remote machine that has a private key paired with a home server public key in the authorized_keys file), use this instruction to remote ssh to account local:
ssh firstname.lastname@example.org -p 1234
tunneling_with_dreamcompute.txt · Last modified: 2022/11/13 07:29 by jtkorb