Blog is moving

My blog is moving to http://victormendonca.com/blog/. If you are looking for a specific or older post you are in the right place Otherwise check out my new page for more up to date content.

Friday, January 4, 2013

How to SSH home without access to router

Do you need to access a Linux box that sits behind a router or modem, however you don't have admin access to configure port forwarding? Well, here's something that might help you.

Before we start, make sure that the remote client machine is able to connect to an IPv6 network (test here).

1- Register for a gogo6/freenet6 account - http://www.gogo6.com/freenet6/registration

2- Install gogoc on the remote server

$ sudo apt-get install gogoc

3- Edit the configuration file with your credentials and your closest broker (mine was montreal.freenet6.net)

$ sudo vim /etc/gogoc/gogoc.conf

userid=
passwd=
server=[your_broker].freenet6.net
auth_method=any

4- Start the gogoc service

$ sudo service gogoc stop
$ sudo service gogoc start

5- If you get the error "* Not starting gogoc - no server key", then follow steps 5a, b and c, otherwise go to step 6:

5a- Add your broker to the tsp-broker-list.txt 

$ cd /var/lib/gogoc/
$ sudo vim tsp-broker-list.txt 

# Add your broker as
[broker].freenet6.net

5b- Start the server in the foreground so you get prompted to accept the key

$ sudo /usr/sbin/gogoc -n -f /etc/gogoc/gogoc.conf
montreal.freenet6.net is an unknown host, do you want to add its key?? (Y/N) y

5c- Wait for about 30 seconds (to be sure), then stop the foregroud process (Ctrl+c) and start it in the background (step 4)

6- Check that an IPv6 address was assigned is running:

$ ifconfig | grep -q inet6 && echo ok
ok

7- Try to connect from the remote client
- If connecting from Linux:

$ ssh -6 [linux_user]@[net6_user].broker.freenet6.net

- If connecting from Windows:

2 comments:

Unknown said...

So I failed on the first step, my machine cannot connect to IPv6. Is there a way to force this?

Victor said...

Hi Marty,

It really depends on your network and if you can configure it.

My work network does not have IPv6 enabled, so I cannot use this method. So when I'm at work I use Hamachi to connect to my desktop at home.

Vic.