Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssh port forwarding - Forwarded connection refused by server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sbyrne
n00b
n00b


Joined: 12 Jun 2002
Posts: 8
Location: Rochester, NY

PostPosted: Thu Jan 09, 2003 6:09 pm    Post subject: ssh port forwarding - Forwarded connection refused by server Reply with quote

I am trying to forward a port through ssh, specifically port 5999 for vnc. I am using putty from a windows machine to make the ssh connection, which works fine. The putty event log says "Local port 5999 forwarding to <myhost>:5999". Then I run a vncviewer for "localhost:99". It doesn't work. The putty event log says "Forwarded connecton refused by server". This happens with both vnc and tightvnc. I tried "iptables --flush" first. I've tried it from multiple windows machines. So I am assuming it is an openssh problem. The only uncommented things i have in my sshd_config are:
PermitRootLogin No
UsePrivilegeSeperation Yes
Subsystem sftp /usr/lib/msic/sftp-server

Any ideas?
Back to top
View user's profile Send private message
Maz
n00b
n00b


Joined: 18 Jul 2002
Posts: 43
Location: Montpeller, France

PostPosted: Fri Jan 10, 2003 5:26 am    Post subject: Reply with quote

Well, I read it like 20 times, and I still don't understand what you are trying to do :? . Or more precisely, how exactly you want to connect with your vnc server.

Could you try to explain it a little better ?
_________________
Maz
Back to top
View user's profile Send private message
thehyperintelligentslug
n00b
n00b


Joined: 30 Jun 2002
Posts: 49
Location: Edinburgh

PostPosted: Fri Jan 10, 2003 11:19 am    Post subject: Reply with quote

Hi,

This is the method I use for forwarding my VNC ports from my flat to my work machine (using puTTY);

At the flat I have a vncserver started.

At work I connect with ssh and forward like this:

Code:

source port     destination

L5801             localhost:5801
L5901             localhost:5901


Now, when I point my browser at localhost:5801 I can access my vnc server.

I think that is what your after.

Cheers,

Neil.
Back to top
View user's profile Send private message
sbyrne
n00b
n00b


Joined: 12 Jun 2002
Posts: 8
Location: Rochester, NY

PostPosted: Fri Jan 10, 2003 3:01 pm    Post subject: Reply with quote

thehyperintelligentslug wrote:
Hi,

This is the method I use for forwarding my VNC ports from my flat to my work machine (using puTTY);

At the flat I have a vncserver started.

At work I connect with ssh and forward like this:

Code:

source port     destination

L5801             localhost:5801
L5901             localhost:5901



Ah! I was trying to do:
Code:

L5999             <server host>:5999

instead of
Code:

L5999              localhost:5999
.

If you are running vnc on 5901, what is the 5801 for?
Back to top
View user's profile Send private message
philthedrill
n00b
n00b


Joined: 10 Jan 2003
Posts: 18
Location: Moscow, ID

PostPosted: Fri Jan 10, 2003 3:12 pm    Post subject: Reply with quote

Could you give a detailed diagram of the machines in your path (client, ssh server, vnc server, etc), including OS info and version numbers of vnc and putty?

I'll give you an example of what I'm doing, because I struggled with port forwarding for a bit.

I want to connect to my home PC from school. At home I have a FreeBSD box running openssh (we'll call it 'zb') and a Windows XP box running vnc server on default port 5900 (we'll call it 'uc'). There's a firewall at home, and the only open port is ssh to zb, so uc is closed to the outside. Traffic between zb and uc (behind the firewall) is unrestricted.

In Putty, I set up the ssh connection as normal. Then under SSH -> Tunnels, I added a new forwarded port.

Source port: 5902 (in your case, 5999)
Destination: uc:5900

The "Local" radio box should be checked, and then I click "Add".

With vncviewer, I type localhost:2, and it should connect.

The concept of port forwarding that tripped me up is the destination. uc:5900 is from the perspective of the ssh daemon, not the ssh client.

If all else fails, start using telnet to log into specific ports and see if they're open. Also, run 'netstat -a' on the machines to view active connections.

HTH.

--phil
Back to top
View user's profile Send private message
philthedrill
n00b
n00b


Joined: 10 Jan 2003
Posts: 18
Location: Moscow, ID

PostPosted: Fri Jan 10, 2003 3:15 pm    Post subject: Reply with quote

Oops. Looks like I was a little late on my post.

Port 5800 is for vncserver through a web server, which can be viewed through a java capable browser.

I've never used it.

--phil
Back to top
View user's profile Send private message
thehyperintelligentslug
n00b
n00b


Joined: 30 Jun 2002
Posts: 49
Location: Edinburgh

PostPosted: Fri Jan 10, 2003 3:21 pm    Post subject: Reply with quote

Hi,

Quote:

If you are running vnc on 5901, what is the 5801 for?


To tell you the truth, I can't quite remember! :roll:

Best guess is that it was when I was trying to get it to work and it just got left there! (didn't mean to post it on here but forgot to edit it out!). :oops:

Ahh, well! :lol:

As for the problem you were having, I remember doing the same thing.

Cheers,

Neil.
Back to top
View user's profile Send private message
thehyperintelligentslug
n00b
n00b


Joined: 30 Jun 2002
Posts: 49
Location: Edinburgh

PostPosted: Fri Jan 10, 2003 3:29 pm    Post subject: Reply with quote

Bingo :!:

Quote:
Port 5800 is for vncserver through a web server, which can be viewed through a java capable browser.

Thanks phil, I was googling away to try and figure out why that was there! I use the web access as we are restricted on what software we can have on our PC's here.

Cheers,

Neil.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum