Hi there, I recently bought a laptop, and while when I’m at home I can connect to my PC , I’d like to be able to do this from abroad too, even, if possible, to control my PC from my laptop as well (This is where the X Forwarding comes in)
Anyway, my PC runs OpenSUSE 11.2 KDE, and my laptop is running Kubuntu 9.10.
My PC at home resides inside of a network to which I am the administrator, and has a static IP address.
I DO NOT have a web server, is this required? Or can I simply connect to my external IP address?
Anyway, if the above is possible, then how I would I tell my ssh to go to the right internal IP address?
And of course, is it possible to forward my X session at home to my laptop and remotely control my PC?
I have this set up and working. If you have a static external IP then you don’t need to use a dynamic DNS service, so that saves the first task. Second is to configure your router to forward the SSH port (default is 22) to your desktop. For this to work you need a new-ish router that supports port forwarding based on MAC address, or to take your PC off DHCP and use a fixed internal IP, then forward ports to that. I used to do the fixed internal IP, now I have a newer router so use the MAC address option.
Thirdly ensure any firewalls have these ports opened.
That will allow you to open an SSH connection from your laptop to your PC, giving you command line access to your desktop. You configure this to tunnel the VNC port (default 5900) so VNC is secure. Forward that port too.
From the command line you can open X11 VNC server to listen on localhost port 5900 (what you tunelled before). The first time it runs you set a password. Once that’s running you use vncviewer on your laptop and point it at localhost::5900, everything should work from there.
I ran your ssh2pc command (Obviously substituting in my own values) from my LAPTOP, which presents me with the command line of my DESKTOP. From there I ran the startvncserveronpc so that it would, well, start the vnc server on my DESKTOP. Then, I opened a new Konsole, and ran your vnc2pc command (Again, substituting your values for mine) (And always leaving parts where you write “localhost” as localhost, I wasn’t sure if I had to change these)
Anyway, the vnc2pc command tell me it’s trying to connect to “localhost:11800” which doesn’t sound right at all, I enter my password, and it gives me a bunch of Java errors, and tells me
that it can’t connect
And if I run vnc2pc while still in my DESKTOP Command Line, I get “Error: Can’t open display”
(I’m only capitalizing Desktop and Laptop to try and make it clear where I’m doing what. Also, thanks for the help and step-by-steps. :))
Ah, but if I remove the 5900 from the vnc2pc command, and run it from my laptop, it works fine. As a matter of fact, I’m writing this from my laptop now
Anyway, thanks again for the step by step instructions, I really appreciate it. I wonder how well this will end up working on my school’s network… I guess I’ll find out.
Okay, so all of a sudden this has stopped working.
At first I was getting an error that
-httpport:5800 -rfbport:5900
weren’t real options. So I read the man, and removed the colon which made it work again. Except I can’t even seem to ssh into my PC (Even though nothing along those lines has changed)
With a “Cannot connect to port 22” thing.
Between then and now I’ve switch my router from a WRT54G2 to a WRT300N both running DD-WRT. But the first thing I did was re-forward my ports for ssh and vnc (22 and 5900 respectively) to my desktops internal IP. So I’m really not seeing what went wrong here.
Hi
Look at using NX (the one from nomachine.com it’s free) then you only
need ssh open, plus I would move it externally to another port (eg
10222) and for that to 22 on the target machine.
–
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.39-0.3-default
up 6 days 0:02, 4 users, load average: 0.05, 0.08, 0.08
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18