ssh – [protofusion] http://protofusion.org/wordpress Open Hardware and Software Tue, 09 Mar 2010 19:39:45 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.13 11753368 Insurgency: Access your linux box from anywhere http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/ http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/#comments Sun, 13 Dec 2009 07:33:15 +0000 http://protofusion.org/wordpress/?p=184 ]]> Routers :: Credit: flicr user stars6

The problem: you have a computer sitting behind a firewall. You want to access it from a different location, but you don’t have the ability to forward any ports to it. The answer: SSH tunneling.

The Solution

Using an SSH tunnel, you can reverse-forward ports from one computer to another. To do this, you will need a computer running linux and sshd to reverse-forward the ports to. It is very convenient if this is the computer you will be using to access the remote machine. Otherwise, additional steps must be taken.

The Setup

The easiest way to set up and maintain a reverse port-forwarding tunnel is with ohnobinki’s insurgent script. The script allows you to specify a remote host and the ports you want to reverse-forward. To start off, create a new user on your system, such as insurgent. Log in or start a shell as this user. Assuming you have mercurial installed, run:

hg clone https://ohnopublishing.net/hg/insurgent

Now cd to the newly created insurgent/bin directory. Finally, place the contents of insurgent/share/contab.txt into your crontab (use crontab -e to edit your crontab).

Now you simply need to configure the script. To do so, open insurgent.sh in your favorite editor, and update the REMOTE_HOST and other variables. The format for ports is [remoteport]:hostname:[localport] (ssh(1) ). I recommend starting with reverse-fowarding SSH (port 22), a vnc session (590x where x is the VNC display number), and nfs.

If you have not done so already, you need to set up passwordless public key authentication for the new insurgent user.

You’re Done!

If you’ve gotten this far, you may be ready to go. You should be able to access any port on your insurgent box via the corresponding port on your local box. Have any problems? Drop some comments below or pop into irc.ohnopub.net#protofusion and speak to ohnobinki or normaldotcom.

Image credit: star6. Used under Creative Commons CC BY-SA 2.0
]]>
http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/feed/ 1 184
Quick and Easy Passwordless public-key auth http://protofusion.org/wordpress/2009/12/quick-and-easy-passwordless-public-key-auth/ http://protofusion.org/wordpress/2009/12/quick-and-easy-passwordless-public-key-auth/#comments Sun, 13 Dec 2009 07:09:18 +0000 http://protofusion.org/wordpress/?p=186 Need passwordless auth with ssh? Need it really really fast? 3 steps and you’re done.

  1. ssh-keygen -t rsa      (don’t enter a passphrase)
  2. ssh-copy-id -i ~/.ssh/id_rsa user@remotehost
  3. ssh user@remotehost

Wasn’t that easy?

]]>
http://protofusion.org/wordpress/2009/12/quick-and-easy-passwordless-public-key-auth/feed/ 1 186