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

Thread: Reverse SSH: Permission denied, please try again.

  1. #1
    Join Date
    Jul 2008
    Beans
    204
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Exclamation Reverse SSH: Permission denied, please try again.

    I have home laptop on 3G - client
    I have sisters laptop on Wi-Fi router - target
    I have dedicated server - middle

    All on Ubuntu

    I created tunnel from target to middle

    Code:
    ssh -R 7778:localhost:22 middleuser@middleIP
    Then I connect to middle from client

    Code:
    ssh middleuser@middleIP
    And from it to target

    Code:
    ssh targetuser@localhost -p 7778
    But here I receive this errror: Permission denied, please try again.

    I actually already have success connections today, but then I broke smth...

    Please help where to look first?

    TIA

  2. #2
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    5,704
    Distro
    Xubuntu Development Release

    Re: Reverse SSH: Permission denied, please try again.

    I think only root is allowed to tunnel privileged ports (under 1024). So you may need to ssh in as root@middleIp.

  3. #3
    Join Date
    Jul 2008
    Beans
    204
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Reverse SSH: Permission denied, please try again.

    But I've had success logins with this users...

  4. #4
    Join Date
    Sep 2006
    Beans
    7,953
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Reverse SSH: Permission denied, please try again.

    Quote Originally Posted by khurtsiya View Post
    I have home laptop on 3G - client
    I have sisters laptop on Wi-Fi router - target
    I have dedicated server - middle

    If you connect from client to target via middle you can do it like this:

    Code:
    ssh -L 7778:target:22 middle
    Then on client you can connect to port 7778 on the localhost. Or are you trying to make it so target can log into client?
    The Truth Shall Make Ye Fret.

  5. #5
    Join Date
    Jul 2008
    Beans
    204
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Reverse SSH: Permission denied, please try again.

    I've changed the port to 7779 and all works now!

    Now I want automate. But tunnel works only if terminal not closed, why?

  6. #6
    Join Date
    Sep 2006
    Beans
    7,953
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Reverse SSH: Permission denied, please try again.

    Try adding -fN to your options on the client when establishing the port forwarding. The -f drops ssh to the background and the -N tells it not to execute a remote command.
    The Truth Shall Make Ye Fret.

  7. #7
    Join Date
    Jul 2008
    Beans
    204
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Reverse SSH: Permission denied, please try again.

    when I add -fN and try to run it by clicking and selecting Run - nothing happens and I am not able to connect from middle - Connection refused - so I believe reverse tunnel not created

  8. #8
    Join Date
    Sep 2006
    Beans
    7,953
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Reverse SSH: Permission denied, please try again.

    What happens when you run it from the terminal? What is the full line that you enter?
    The Truth Shall Make Ye Fret.

  9. #9
    Join Date
    Jul 2008
    Beans
    204
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Reverse SSH: Permission denied, please try again.

    When I run this from terminal I've god prompt: middleuser@middleserver:~$
    sshpass -p password ssh -R 7779:localhost:22 middleuser@middleIP
    and after this I can connect from client
    but if I type exit followed by Enter key - I've got "logout" and it logs out when I close connection on client side
    if i close terminal - connection closes on client side

  10. #10
    Join Date
    Sep 2006
    Beans
    7,953
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Reverse SSH: Permission denied, please try again.

    Adding -fN like this should allow it to stay running after the terminal is closed:

    Code:
    sshpass -p password ssh -fNR 7779:localhost:22 middleuser@middleIP
    The Truth Shall Make Ye Fret.

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •