#7 sshpass 1.05 hangs


When I run
sshpass -p 'password' ssh user@host
as any user other than root, it hangs.

If I run it as root, it works fine. I'm unsure as how to check for any errors/issues.


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-05-23

    I'm using the sshpass in the community repo for archlinux, if that provides any additional help

  • Shachar Shemesh

    Shachar Shemesh - 2015-04-24
    • Group: --> v1.0 (example)
  • Shachar Shemesh

    Shachar Shemesh - 2015-04-24

    I suspect this is some misconfiguration on your server side. Due to the ticket's age, I'm closing. If the problem is still relevant, please reopen with detailed command line.

  • Shachar Shemesh

    Shachar Shemesh - 2015-04-24
    • status: open --> closed-wont-fix
  • David Ruggiero

    David Ruggiero - 2015-04-25

    So funny you just updated this 18 hours ago; I found this thread because I'm having the same issue today. Root login works fine; anything else hangs. strace shows the process is getting to the ssh/sftp password prompt just fine, then hanging there.

    I'm using RHEL 6.6 i86_64. I'll post the straces for both the successful root login and the unsuccessful non-root one.

  • Shachar Shemesh

    Shachar Shemesh - 2015-04-25

    David, please try the latest version from SVN. I changed the word used to detect password prompts from "assword:" to "assword" (that one always makes me laugh. I guess I do have common interests with my 4 y.o. daughter after all).

    • David Ruggiero

      David Ruggiero - 2015-04-25

      It will be Monday but I will do that. Not sure though why that would make a
      difference for root vs. non-root, but if it works I'm not going to argue.
      :) Thanks for the quick response.

      Last edit: Shachar Shemesh 2015-04-25
  • Shachar Shemesh

    Shachar Shemesh - 2015-04-25

    It is possible your ssh client produces a different password prompt based on whether you are connecting as root or not, with the non-root prompt not being recognized by sshpass.

    Whether working or not, I would appreciate it if you also posted both password prompts here, for future reference (i.e. - the output of running the ssh command without sshpass).

  • David Ruggiero

    David Ruggiero - 2015-04-27

    Shachar - here's the prompt we're getting from sftp as a non-root user, in context:

    $ sftp -oPort=5222 cxxxt@xxx.xxxxus.com
    Connecting to xxx.xxxxxus.com...
    Enter passphrase for key '/home/xyzz/.ssh/id_rsa':

    and here's the same thing but with ssh instead:

    $ ssh -p 5222 cxxxt@xxx.xxxxxus.com
    Enter passphrase for key '/home/xyzz/.ssh/id_rsa':

    So those look the same. More to come.

  • David Ruggiero

    David Ruggiero - 2015-04-27

    oh, btw, the environment:

    sh-4.1$ uname -a
    Linux d3server.xyzz.org 2.6.32-504.16.2.el6.x86_64 #1 SMP

    sh-4.1$ ssh -v
    OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

  • Shachar Shemesh

    Shachar Shemesh - 2016-07-02
    • status: closed-wont-fix --> invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks