NTNT
NTNT

Reputation: 541

Run ssh-askpass in Cocoa app

I'm trying to run the SSHFS command in Cocoa app. I already put the SSHFS command in NSTask and but i got some error when executing the command:

RSA host key for IP address 'xyz.com' not in list of known hosts.

ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

Permission denied, please try again.

ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

Permission denied, please try again.

ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

Permission denied (publickey,password).

remote host has disconnected

mount_osxfusefs: failed to mount /Volumes/Drive_Test@/dev/osxfuse4: Socket is not connected

In this case i think my app cannot find out the ssh_askpass. My question is how to run this file? Any suggestion would be appreciated. Thanks in advance.

Upvotes: 0

Views: 303

Answers (1)

tripleee
tripleee

Reputation: 189357

ssh-askpass is an X11 application which is not directly compatible with MacOS. You can install a custom ssh-askpass in the same path, though it's a bit of a hack. Here is one implementation, though I can't vouch for its integrity or security, or compatibility with current MacOS. (See also blog at https://jcs.org/notaweblog/2011/04/19/making_openssh_on_mac_os_x_more_secure by the same author with forays into other possible approaches.)

A better and more modern solution is to let the MacOS keychain handle things for you. See e.g. SVN+SSH, not having to do ssh-add every time? (Mac OS) (not just for SVN obviously).

Upvotes: 1

Related Questions