Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ssh tunnel problem

  • 01-02-2009 9:53pm
    #1
    Closed Accounts Posts: 1,444 ✭✭✭


    I've got this setup:

    (laptop) --c1-- (machineA) --c2-- (machineB)

    c1 is connection 1: ports 22, 80 and 443 are open, all the rest closed
    c2 is connection 2: ports 22, 80 and 443 are open, all the rest closed

    I've root access on 'laptop' and 'machineB', I've an account on 'machineA' and can't make config changes.

    I would like to get gFTP (ssh protocol) working.

    On 'laptop' I do:
    laptop> ssh -L 9999:machineB:22 username@machineA
    

    I then try and connect "directly" to machineB using:
    laptop> ssh username@localhost:9999
    

    ^^^ this isn't working! I get the following error:
    "ssh: Could not resolve hostname localhost:9999: Name or service not known"

    When I type http://localhost:9999 into my internet browser, I get the following:

    "SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2", so something is definitely happening on localhost, port 9999.

    My ultimate objective is to be able to fill in the username, address and port fields in gFTP as cantab, xxx.xxx.xxx.xxx and 9999 respectively.

    I'm completely stumped... Anyone have any suggestions?


Comments

  • Closed Accounts Posts: 139 ✭✭utopian


    should that not be ssh -p 9999 username@localhost?


  • Closed Accounts Posts: 228 ✭✭gnxx


    Try ssh localhost -l <username> -p 9999


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    utopian wrote: »
    should that not be ssh -p 9999 username@localhost?

    Thanks for that!

    I was just about to paste this solution which I tried literally 30 seconds ago:
    ssh -p 9999 -l cantab localhost
    

    Works a treat!

    You're dead right!

    I don't know why my original syntax wouldn't work... How and ever.

    Do you know, I filled in the fields in gFTP and I got a perfect connection! I just presumed it wouldn't work in gFTP cos it wasn't working on the command line.


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    Anyone got any advice as to how I can run rsync over ssh? (server structure as in OP -- I want to rsnapshot to do a daily backup from 'machineB' to 'laptop' -- yes, 'laptop' is permanently fixed to the web...)

    Rsync needs port 873

    Could I do:

    ssh -p 9999 873:machineB:22 cantab@localhost

    These ssh tunnel gymnastics are making me go dizzy...

    511.gif


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    you can use rsync over ssh with the following command line option:

    --rsh=ssh


  • Advertisement
  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    Khannie wrote: »
    you can use rsync over ssh with the following command line option:

    --rsh=ssh

    You legend!

    Gosh, boards has been particularly useful over the last two days.

    I've just modified my rsnapshot.conf file to accomodate that.

    'rsync_long_args --rsh=ssh'

    I'm really learning things the hard way over here...


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Ah, I wouldn't beat yourself up. It's a bit of a long learning process with unix. You pick up stuff like this along your travels, then 5 years from now you'll come across some problem and remember this. :)


Advertisement