LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-04-2014, 11:32 AM   #1
emdiesse
LQ Newbie
 
Registered: Jan 2012
Posts: 13

Rep: Reputation: Disabled
VNC through SSH gateway


I am trying to connect from a windows or linux machine ('Laptop') through a SSH server ('Server') to a VNC server ('Desktop').

I have attached a diagram which best demonstrates exactly what I am trying to achieve .

Click image for larger version

Name:	VNCthroughSSHgateway.png
Views:	133
Size:	15.5 KB
ID:	14882

What I have tried so far is this:

[emdiesse@Laptop]$: ssh home.net
emdiesse@Server password:*****


[emdiesse@Server]$: ssh -L 5901:localhost:5901 Desktop
emdiesse@Desktop password:*****


[emdiesse@Desktop]$:vncserver
New 'X' desktop is Desktop:1


[emdiesse@Laptop]$: vncviewer home.net:5901

Error in TightVNCViewer: No connection could be made because the target machine actively refused it


I have port forwarding set up on my router for SSH (22) and VNC (5901) going to my Server

So, now I'm a bit stuck

Does any of this make any sense and am I doing anything right, what next?

Thanks
 
Old 03-04-2014, 11:50 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,466

Rep: Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218
Yes and no...

You should be able to find lots of examples on how to ssh tunnel to another server.
What is home.net? dynamic DNS hostname?

You will need to foward port 22 from the router to your ssh server.

ssh -L 5901:vncserver:5901 username@home.net

Start vncviewer on the laptop and select localhost as the server.

Last edited by michaelk; 03-04-2014 at 11:54 AM.
 
Old 03-04-2014, 11:51 AM   #3
emdiesse
LQ Newbie
 
Registered: Jan 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Yes and no...

You should be able to find lots of examples on how to ssh tunnel to another server. What is home.net?

ssh -L 5901:vncserver:5901 username@ssh-server

vncviewer localhost
Sorry, home.net is dynamic dns (well, an example)

I have just tried:
ssh -L 5901:vncserver:5901 username@ssh-server
vncviewer localhost::5901

and it works

Thank you very much.

Last edited by emdiesse; 03-04-2014 at 11:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VNC Over SSH | Linux laptop -> Linux SSH Server -> Windows VNC Server jakestaby Linux - Networking 3 01-28-2009 03:33 PM
VNC through SSH ohswrestler2009 Linux - Newbie 2 10-16-2007 06:17 PM
VNC Forwarding from Linux Gateway roopunix Linux - Networking 9 01-11-2007 07:53 AM
VNC Forwarding from Linux Gateway roopunix Linux - Networking 0 01-09-2007 06:33 AM
VNC gateway eendoe Linux - Security 6 12-20-2006 07:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration