Need help with ssh

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Here's the issue... my friend doesn't have access to his router and so he can't forward ports. In Windows I can simply have him connect to my netmeeting server and I can control his desktop and stuff. Is it possible in Linux, via either vnc,ssh,or any other remote control system, to have him connect to ME, and allow me to control his system?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Sure. If you're running an ssh server, have him connect like so:
ssh -R 5900:localhost:5900 your.ip
Assuming he has a vnc server running on port 5900. Then just use your vnc client to connect to your machine, port 5900 and it'll get tunneled back. Sometimes vnc stuff likes to get picky about connecting to and accepting connections from localhost (try it on a windows box some time :p) so you might have to tell it to allow that.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
kamper: Thanks..

I'm confused, he has to setup sshd on port 5900 or I do? Do I need sshd running at all?

So what do I do on my machine? Setup my sshd on port 5900 first right? sshd -p 5900 ? He does that as well on his machine?
And then my friend types: ssh -R 5900:localhost:5900 MY.IP
And then I type: ssh MY.IP -p 5900

Then I login with his root? password...

Does that look correct? I need to forward my port 5900 in my router settings?

I would just be trying it but he got disconnected and I'm getting impatient. ;)
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
No :p

You run sshd on the normal port and he connects with the above command. The -R flag does reverse port forwarding, so sshd binds to port 5900 on your machine and, when you connect to that port with your vnc client, it tunnels the vnc traffic over port 22 back to your friend's machine and sends the traffic to port 5900 there, where he should have a vnc server listening.

Afaik, you can't get shell access to his machine via ssh if his firewall is shut (I guess you could reverse tunnel port 22, but I don't know how well that'd work).
 

mysteryradeon

Junior Member
Apr 6, 2006
2
0
0
You have to setup openvpn first after which u get a new network device and IP on both systems throught which you can communicate. opevpn .


If you cannot setup openvpn properly or it did not work, use hamachi which is a lot easier to set up.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Wow, I tried hamachi. Simply amazing. Needless to say we got quake3 and ssh working. Thanks! ;)