User Tools

Site Tools


tunneling_with_dreamcompute

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tunneling_with_dreamcompute [2017/11/04 05:01] jtkorbtunneling_with_dreamcompute [2019/06/14 15:50] jtkorb
Line 3: Line 3:
 These steps set up remote access to a home network using an ssh tunnel to a DreamCompute host. These steps set up remote access to a home network using an ssh tunnel to a DreamCompute host.
  
-  - At the DreamCompute [[https://iad2.dreamcompute.com/project/access_and_security/|Access and Security]] panel...+  - At the DreamCompute [[https://iad2.dreamcompute.com/project/security_groups/|Security Groups]] panel...
     - 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 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.     - Create a Key Pair, download the public key (e.g., ''cloud.pem''), and put it in the home server ''~/.ssh'' directory.
   - At the DreamCompute [[https://iad2.dreamcompute.com/project/instances|Instances]] panel, launch a new instance (Boot Source Image Ubuntu 16.04, Flavor gp1.subsonic), selecting the newly created Security Group and Key Pair.   - At the DreamCompute [[https://iad2.dreamcompute.com/project/instances|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''.   - 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 at the end (assuming default user is ''ubuntu''):<code>+  - 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 is ''ubuntu''):<code>
 ClientAliveInterval 30 ClientAliveInterval 30
 ClientAliveCountMax 3 ClientAliveCountMax 3
Line 14: Line 14:
 Match User ubuntu Match User ubuntu
     GatewayPorts yes     GatewayPorts yes
-</code>+</code>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'' and ''update'', ''upgrade'', ''dist-upgrade'', and ''autoremove''. And, reboot.   - While connected to the Dreamhost instance, do ''sudo apt-get'' and ''update'', ''upgrade'', ''dist-upgrade'', and ''autoremove''. And, reboot.
   - On home server, create a ''~/.ssh/config'' file with something like this...<code>   - On home server, create a ''~/.ssh/config'' file with something like this...<code>
Line 27: Line 27:
 RemoteForward *:9999 192.168.1.192:2222 RemoteForward *:9999 192.168.1.192:2222
 </code> </code>
-  - Manually ssh to remote host, before using autossh, to set entry in known_hosts file.  Then, add this line to crontab:<code>+  - Add this line to crontab:<code>
 @reboot autossh -fN tunnel @reboot autossh -fN tunnel
 </code> </code>
tunneling_with_dreamcompute.txt · Last modified: 2022/11/13 07:29 by jtkorb