-- UPDATE --
Yes, well.. Ahem. The problem have been solved. It was a renegade /etc/hosts file with some wrong data in it.
Amazing to think how many hours I've "wasted" tracking down such a minor thing. LOL
-- END OF UPDATE --
Hey guys,
I'm having some weird SSH tunneling issues.
The setup:
1 Slackware 12.0 client
2 Slackware 11.0 servers
The goal:
Forward port 445 via an SSH tunnel from client to server. Basically I need to be able to use mount.cifs on an external server over WAN.
The "weirdness" stems from the fact that this works flawlessly connecting to server1, but it craps out on me on server2. The two servers are identical, insofar as they are running with the same sshd_config (ports are different though) and the same smb.conf.
When creating the tunnel, I do this for server1:
Code:
ssh -fNL 445:server1:445 root@server1 -p 2201 -vvv
and this for server2:
Code:
ssh -fNL 445:server2:445 root@server2 -p 2202 -vvv
The -vvv setting is only there for debugging purposes.
After having created the tunnel to server1, I can run smbclient on the client, and I'm then greeted with a nice list of all the samba shares on server1. I can mount the shares using mount.cifs and all is well.
Doing the same with server2 yields this output:
Code:
debug1: Connection to port 445 forwarding to server2 port 445 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: No route to host
debug1: channel 2: free: direct-tcpip: listening port 445 for server2 port 445, connect from 127.0.0.1 port 47823, nchannels 3
debug3: channel 2: status: The following connections are open:
#2 direct-tcpip: listening port 445 for server2 port 445, connect from 127.0.0.1 port 47823 (t3 r-1 i0/0 o0/0 fd 6/6 cfd -1)
debug3: channel 2: close_fds r 6 w 6 e -1 c -1
On the server, in /var/log/syslog, I get this:
Code:
Sep 10 08:26:59 server sshd[9705]: error: connect_to server port 445: failed.
At first I thought I might've had some sort of firewall problem, but this happens even when I'm creating the tunnel from the same LAN as server2, ie. no firewalls between the client and the server. And yes, doing a regular smbclient -L server2 --user=SomeUser does indeed result in a nice long list of samba shares. Samba is running and working as intended. Server2 is currently hosting files for some 20 local (same LAN as server) clients.
What am I missing here?
The first thing I did was getting rid of the sshd_config file on server2 and replacing it with a copy of the one from server1. The only thing I've changed is the port. I then stopped/started SSHD on server2 and hoped for the best. Obviously my hopes were crushed.
Then I compared the two smb.conf files, but besides having different shares setup, they are also the same.
Both server1 and server2 are sitting behind a monowall firewall, and I can SSH into both machines using both keys and passwords. It's also worth noting that both tunnels are created without errors, it's only the connection to port 445 that fails on server2.
I'm at a loss here. Anybody got any ideas?
All involved machines are running with the latest official updates installed.
/Thomas