LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   ssh with vnc (https://www.linuxquestions.org/questions/linux-security-4/ssh-with-vnc-300418/)

Dillius 03-11-2005 10:13 AM

ssh with vnc
 
I've seen plenty of these posts, and i've searched up even more of them. I've googled lots of little instructions up too, but maybe i'm just missing something.

I am, quite simply, just trying to tunnel vncviewer through SSH. It seems that no matter what syntax I try this thing just isnt working, so i'm breaking down and posting about it.

Here are the many syntax's i have both seen and tried, and yet I still can not get it to work.

ssh -L 5902:{remotecompip}:5901 -> syntax error aparently

apparently I was supposed to specify another IP address at the end of this statement

ssh -L 5902:{remotecompip}:5901 {localcompip}

All this accomplishes is myself logging into the local computer. I also attempted to swtch the local comp ip and the remote comp ip, at which point i simply logged into the remote machine with SSH. Something tells me this is not really what i'm looking to do, as I don't see why i need to remotely connect just to forward the port.

Would greatly appreciate someone clearign up this problem for me.

EDIT: Changed some writing due to evil invading smilies

DaHammer 03-11-2005 04:53 PM

I use x11vnc to do it. On the client, a Windows laptop in my case, I use plink to make the connection. I have a shortcut on my desktop that just runs the following:
Code:

"C:\Program Files\Putty\plink.exe" -L 5900:localhost:5900 hammer@192.168.1.2 `runx11vnc`
On the server, this is what runx11vnc consists of:
Code:

#!/bin/sh

x11vnc -rfbauth $HOME/.vnc/passwd -display :0

After entering the password, you should see something like this:
Code:

11/03/2005 16:48:03 setting up 32 cursors...
11/03/2005 16:48:03  done.
11/03/2005 16:48:03 Autoprobing TCP port
11/03/2005 16:48:03 Autoprobing selected port 5900
11/03/2005 16:48:03 created 32 tile_row shm polling images.
11/03/2005 16:48:03 screen setup finished.
11/03/2005 16:48:03
11/03/2005 16:48:03 The VNC desktop is corvette:0

At that point, you can just exit that window, it's no longer needed. Then on the client, use your vncviewer to log in as normal. I like Tightvnc personally, but Realvnc will work as well.

There are several different ways of doing it, but this is what works for me. Good luck.

Note: If you use the "runx11vnc" script above, you'll need to make it executable and place it in your PATH. I have it at /usr/local/bin/runx11vnc. You'll also need to already have set a vnc password if you use the password auth.


All times are GMT -5. The time now is 08:47 AM.