۱۳۹۰ شهریور ۳۱, پنجشنبه

reverse ssh tunneling

It's obvious that I need to connect to my computer at work, from my computer at home.

The problem is that the lab computer is behind a firewall in a NAT. They provide us a web based interface to access our computers which is awful.

A naive idea is that to run an agent on the lab computer to hook some file on the web, read commands from there, and place results somewhere there. But there should be a way in open source world to do that easier. I was sure that guys did that before.

So I googled "reverse ssh to a computer on a nat". That was the first thing which I could search for. And that was really the answer. "Reverse SSH Tunneling" is the way you can do that. Then I used this page.

But I used my own computer at home to work as server. Yes I did a port forwarding on my router which is always alive. But I don't want my home computer be on all the times. So I have to find a way to make sure that the line is up even there is a disconnection for whatever reason; even restarting my home computer.

Googling something like "automatic ssh reconnect" yields to the solution. I choose this page and saved it as a script on my lab computer. So I run it under a terminal when I turn on my lab computer. I couldn't give it to "at" command. I don't know why it didn't work but that works for me.

The last thing is that I want ssh to be done without any password requirement. So I googled "automatic ssh login" and used this page for that. The last problem was that I already generated a private key for myself and set a password for that. Now I want to remove that password so that the ssh is done completely automatic.

So this is what I googled: "how to remove password from generated private key". And using this page I removed the password from my private key and replaced the new one with the old one.

OK, let's go home and work from there ;)

هیچ نظری موجود نیست: