Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: SSH tunnel not working

  1. #1
    Join Date
    Apr 2005
    Beans
    24

    SSH tunnel not working

    I'm having trouble getting an SSH tunnel to work.

    I have a Windows client running an ftp server on port 55555. I've tested it locally and it's working.

    I'm connecting to my server using plink (command line putty) using this command:

    plink user@serveraddress.com -R 55555:localhost:55555
    I've also tried:
    plink user@serveraddress.com -L 55555:localhost:55555

    in either case I can run netstat -tunelp | grep 55555 to see that the port appears to be open. However when it try to connect to the windows ftp by typing in ftp localhost:55555 on the Ubuntu machine it just says something about an unrecognized service and doesn't connect.

    Any ideas?

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: SSH tunnel not working

    Hi jasbur.

    I have a couple of questions:
    Is serveraddrress the Linux machine or the Windows?

    Are you running plink on the Windows machine or the server?
    Regards.

  3. #3
    Join Date
    Apr 2005
    Beans
    24

    Re: SSH tunnel not working

    Yes, the server is on Linux and I'm using plink as the client on Windows.

  4. #4
    Join Date
    May 2012
    Beans
    122

    Re: SSH tunnel not working

    Sounds like a firewall issue to me, probably Windows firewall (I presume ftp client is installed on server). Take plink out of the mix and see if you can connect by LAN IP address to Windows client from server.

    Also, you should probably put the FTP service on your server and connect from your client PCs (in your case the Windows PC).

    I have had issues connecting to Windows computers to secure copy files using pscp (think it was a username issue), but I don't think that is your issue here. Try as suggested above, hopefully that will get you sorted.

  5. #5
    Join Date
    Apr 2005
    Beans
    24

    Re: SSH tunnel not working

    Actually the ftp server is just for testing purposes. Eventually I'd like the Windows computer to be running an instance of VNC. I'm trying to use tunneling to bypass a customer's firewall (for remote support). My understanding is that no ports should need to be open on the Windows computer to achieve this.

    By the way I have tried local network access to the ftp server and it works fine. Again, wouldn't the tunnel bypass it anyway?

  6. #6
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: SSH tunnel not working

    I would have expected
    plink user@serveraddress.com -L 55555:localhost:55555
    to be the one that works. Maybe the "localhost" is sent to the windows box which can't resolve that name. Try this:
    plink user@serveraddress.com -L 55555:127.0.0.1:55555
    but you sre still unlikely to get ftp to work properly because it uses other connections on other ports (that you're not tunneling) to do the data transfers. The login should succeed, but not data transfers (that includes directory listings).

  7. #7
    Join Date
    May 2012
    Beans
    122

    Re: SSH tunnel not working

    By the way I have tried local network access to the ftp server and it works fine
    What command are you typing on your Linux server machine to connect successfully to FTP server running on your Windows machine, as you indicated above?

    https://help.ubuntu.com/community/SS...PortForwarding

    Ports numbers less than 1024 or greater than 49151 are reserved for the system, and some programs will only work with specific source ports, but otherwise you can use any source port number.
    Might be the problem, try a lower port number - after that it's been so long since I worked with creating SSH tunnels (actually for use with VNC), I'd be probably wasting your time than helping.
    Last edited by kennethconn; May 26th, 2012 at 08:11 PM.

  8. #8
    Join Date
    Apr 2005
    Beans
    24

    Re: SSH tunnel not working

    Actually it looks like
    Code:
    plink -R 55555:localhost:55555
    should be the right choice according the article posted above, because the connection would be originating from the Linux box into the Windows box.

    I'm using the command
    Code:
    ftp localhost:55555
    To try to connect from the Linux box.

  9. #9
    Join Date
    May 2012
    Beans
    122

    Re: SSH tunnel not working

    I would disagree with that and say the command should be:

    plink -L 55555:localhost:55555

    actually I would be trying something like:

    plink -L 12345:localhost:55555

    ftp localhost:12345


    But what I wanted to know is what command you typed from the linux box to connect to the Windows machine when you said that "I have tried local network access to the ftp server and it works fine"?

  10. #10
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: SSH tunnel not working

    I was so concern trying to understand the network layout, that I forget something very important: we are dealing with ftp.

    ftp is an old, limited, and I even say natty protocol.

    From 'SSH: The Secure Shell - The Definitive Guide':
    To understand the problems between FTP and SSH, you need to understand a bit about the FTP protocol. Most TCP services involve a single connection from client to server on a known, server-side port. FTP, however, involves multiple connections in both directions, mostly to unpredictable port numbers...
    So, in short, it looks like a simple one-port tunnelling won't work with ftp.

    Here is some useful information: FTP Forwarding.

    I hope that helps,
    Regards.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •