Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-02-2008, 12:17 PM   #1
LQ Newbie
Registered: Aug 2005
Location: Charleston, SC.
Posts: 17

Rep: Reputation: 0
Question SSH Tunnels - Connection Refused

Having trouble getting an SSH tunnel to connect to my Slackware 12.0 box.

Here's my setup:

- ROUTER: forwards port SSH_PORT to SLACKWARE_12 (which I can log in fine) and forwards FORWARDING_PORT to SLACKWARE_12
AllowTcpForwarding yes
...firewall: allows the FORWARDING_PORT

Now I've tried it behind the router with the same results: Connection refused.

I don't know if it is sshd stopping the tunnel or what. inetd?

I'll try a local tunnel to see if I can at least do that.


Last edited by pricejm; 01-02-2008 at 12:18 PM.
Old 01-02-2008, 03:26 PM   #2
Senior Member
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
This might help. Depending on what you're trying to tunnel, you could use SSH as a socks proxy.
Old 01-06-2008, 09:16 PM   #3
LQ Newbie
Registered: Aug 2005
Location: Charleston, SC.
Posts: 17

Original Poster
Rep: Reputation: 0

I'll have to try the SSH and SOCKS out...

So I can do this:

# ssh -L 2001:localhost:25 localhost

then in that session I can telnet to localhost 2001 and get my smtp...

So I still don't know why it want let any external sessions.

If I add a "PermitOpen" to the sshd_config I'll get the error message in Putty: Forwarded connection refused by server: Administratively prohibited [open failed]

Something's changing for sure.

If I had the "PermitOpen any" I get the connection refused again.

The ports are open through the firewall, unless I'm screwing that up (I'm getting different responses, so I'd think I have the firewall right though).

I'm totally baffled at this point.
Old 01-07-2008, 04:32 AM   #4
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Disable firewall for now.
Old 01-07-2008, 11:33 AM   #5
LQ Newbie
Registered: Aug 2005
Location: Charleston, SC.
Posts: 17

Original Poster
Rep: Reputation: 0
I set the firewall to accept all by default.

Something I thought was interesting:

sshd[12657]: debug1: server_request_direct_tcpip: originator port 0, target port 7777

When it works from my router, i.e. ssh -L 2000:server:25 or whatever, I get:
sshd[12550]: debug1: server_request_direct_tcpip: originator port 59556, target port 25

So maybe figuring out why I'm not getting an originating IP might fix me.
Old 01-07-2008, 11:55 AM   #6
LQ Newbie
Registered: Aug 2005
Location: Charleston, SC.
Posts: 17

Original Poster
Rep: Reputation: 0
Lightbulb Finally

OK. I might be an idiot, but this seemed to fix it:

The hostname has always been domain-serv, since I always thought of my router as being after running `hostname`...bam! It finally works...

I guess sometimes it is too simple. sshd had to be resolving to my router, ergo the connection failed.

I spent a couple weeks on this just for one command to fix it...but I learned much in the process.

Now I'm only a Level 2 idiot.

Last edited by pricejm; 01-07-2008 at 11:57 AM.


ssh, connection, sshd, forwarding, tcp, refused, tunnel

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
SSH - Connection Refused eminence Linux - Networking 14 03-06-2012 01:22 AM
SSH Connection Refused? lowpro2k3 Linux - Networking 2 11-04-2009 12:02 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 05:38 PM
SSH connection refused theoneandonly19 Red Hat 1 07-01-2007 03:48 AM
SSH Connection Refused meping Linux - Networking 9 04-15-2006 02:04 AM

All times are GMT -5. The time now is 05:51 AM.

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