3 Replies Latest reply: Apr 2, 2009 3:16 PM by Rick Anderson
Rick Anderson Level 2 Level 2 (165 points)
I have a task running in launchd that transfers files to remote machines via scp and lately it's been failing. When I run the scp command on the command line, it prompts for a password. I have the rsa files set up on the local and remote machines and have been doing this kind of password-less login and file transfer successfully for a very long time. This just started happening. Does anyone know if any recent updates broke this? If so, what specifically is going on?

Here's what the failing scp command looks like:

scp /Volumes/data/secure1/public_html/forms/classifieds/sunlist.js loginname@secure1.domainname.com:public_html/forms/classifieds/

Every time the script tries to run in launchd, this shows up in the system log:

*Notice ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice Permission denied, please try again. 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice Permission denied, please try again. 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice Permission denied (publickey,gssapi-with-mic,password). 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

*Notice lost connection 3/31/09 Tue, Mar 31, 2009 12:11:01 PM*

Message was edited by: Rick Anderson (posted too much stuff from the log, removed some for clarity.)

Mac OS X (10.5.6)
  • Rick Anderson Level 2 Level 2 (165 points)
    Tinkering with this, I just discovered something odd.

    I'm running the scp command above in backticks in a perl script like this:

    `scp ...`;

    When I take the scp command by itself and run it on the command line, it fails. I just ran it in verbose mode to see what it was doing and it succeeded. (???)

    When I then run it from the perl script, it prompts for the password again.

    I'm stumped.
  • BobHarris Level 6 Level 6 (15,150 points)
    Have you messed with the protections on your $HOME directory or the $HOME/.ssh directory on either system?

    Under some permissions conditions, will not trust a key if it thinks that someone could have replaced the key, or the entry in the authorized_keys, or messed with the user's home directory.

    A complete list of required file permissions is provided in the *man ssh" man page.

    Does your passwordless login fail is you use ssh?

    ssh -v -v -v username@remote.system.address
  • Rick Anderson Level 2 Level 2 (165 points)
    Bob, thanks for responding.

    I had already found out about the permissions issue in Googling about this but I kept finding people recommending different permissions settings. I didn't know it was spelled out in the ssh manual so thank you for that. (And FWIW, it was already set correctly.)

    The SSH connection does not fail, but then again, now I'm not having any problems with SCP anymore either. It seems to have gone away on its own so hopefully this is one of those mystery problems that just fixes itself.

    Thanks for the info though. The -vvv flag will help next time if it starts up again.

    Message was edited by: Rick Anderson