TheFox
TheFox

Reputation: 502

Mac OS X Lion and sshpass

I've upgraded from Mac OS X Snow Leopard to Lion. I used several scripts with sshpass but after I upgraded to Lion the following error appears:

Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 502
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

I can only connect with sshpass or type the password manually. No public/private key way. I've reinstalled MacPorts and sshpass.

How can I get ssh-askpass? How can I configure /dev/tty ?

Greets!

Upvotes: 1

Views: 7068

Answers (2)

Walty Yeung
Walty Yeung

Reputation: 3564

it stuck me for a long time, and finally found the hint here:

in simplicity, if one wants to do something like following in mac lion:

sshpass -p pass ssh user@host

he only needs to:

  1. set up a script called pass.sh with following:

    echo pass

  2. set up the environment variable

    export SSH_ASKPASS=~/bin/pass.sh

  3. the ssh could now be done by this:

    sshpass ssh user@host

If you want to get the password from the keychain, you better watch the second answer of this link.

Upvotes: 0

raizdepi
raizdepi

Reputation: 76

I think there is a bug in the sshpass that don't remove DISPLAY. Try to unset DISPLAY before run sshpass. EX:

unset DISPLAY; sshpass -p pass ssh host

Upvotes: 1

Related Questions