Ssh_askpass: exec("/usr/bin/ksshaskpass"): No such file or directory

KDE Plasma 6 is installed on my current ArchLinux system. When I try to ssh from an unprivileged Konsole terminal to any local system that I have not been to before, even one which I have provisioned with a public key in its ~/.ssh folder, I get the message “ssh_askpass: exec(”/usr/bin/ksshaskpass"): No such file or directory." If I “sudo ssh” from the Konsole terminal to the same account, the ksshaskpass prompt will appear. If I type “ksshaskpass” from an unprivileged prompt, the ksshaskpass prompt will appear. ksshaskpass is at /usr/bin/ksshaskpass and has 755 permissions. I have been able to workaround the problem by logging into each host once by “sudo ssh” and them replacing ~/.ssh/known_hosts with /root/.ssh/known_hosts. Any idea what the problem is?

Hi! Just to check, have you followed the Arch wiki’s guide to setting up KDE Wallet to store passphrases using ksshaskpass? KDE Wallet - ArchWiki

If you have issues using that method, I personally found success using @soumyadghosh 's guide here: SSH Keys and KWallet: Getting rid of SSH asking passphrase | Soumya's Web

One flag that does jump out at me is running sudo ssh - when you do that, you’re connecting not as your regularly signed-in user account, but as the user root, so key exchanges, trusted hosts, etc. happen for root, and won’t happen for your own user account.

As a general guideline for basic local network use like mine, and I suspect for yours too:

  • Configuring an SSH server - setting the server’s public and private keys, changing its configuration to allow or deny different ways of logging in, etc. - requires using the root user (typically via sudo) to edit server configuration files that it owns, and to do things like restart the SSH server’s service. For example, the server’s public and private keys are (by default) stored in root-owned files under /etc/ssh/.

  • Configuring and running an SSH client - the machine you’re actually running the command ssh <something> from - happens as your own user, no sudo required. Your user’s home directory is where your client keys to access servers are stored, along with the list of known hosts - by default under ~/.ssh/.

Related to the specific error message that you got, does the file /usr/bin/ksshaskpass exist? It could in fact be missing from that location, while you might still be able to run it from a terminal prompt, if it’s in another location that’s also included in your PATH environment variable.

After making sure that the ksshaskpass package is installed correctly with that file in place, it might be worthwhile to double-check that your environment variable SSH_ASKPASS is defined as "/usr/bin/ksshaskpass".

Hopefully at least some of that is helpful for the situation you’re in! :slight_smile:

1 Like