salt icon indicating copy to clipboard operation
salt copied to clipboard

ssh_auth hard dependency on homedir

Open hazaelsan opened this issue 12 years ago • 4 comments

ssh_auth.present gives an error when a user's homedir does not exist, even if the keys are not being saved anywhere in the homedir. The error I get is: "Failed to add the ssh key. Is the home directory available, and/or does the key file exist?"

In my scenario, ssh keys are in /etc/ssh/keys/$USER. The home directory is indeed missing, but I don't see why it should be a requirement in this case.

Tested with version 2014.1.4.

hazaelsan avatar Jun 14 '14 04:06 hazaelsan

Thanks for the report. Should be an easy fix.

basepi avatar Jun 16 '14 17:06 basepi

Ah, I see the problem. From the docs:

    config
        The location of the authorized keys file relative to the user's home
        directory, defaults to ".ssh/authorized_keys".

Note the "relative to the user's home directory". I'm going to add functionality such that if that path is an absolute path, it will use it as an absolute path.

basepi avatar Jun 20 '14 22:06 basepi

This one bites me as well. We do not allow users to keep keys in their home directory. We use the AuthorizedKeysFile directive in /etc/ssh/sshd_config:

AuthorizedKeysFile    /etc/ssh/authorized_keys/%u

tracphil avatar May 27 '15 13:05 tracphil

Closing as fixed by the above PR. If the problem still exists, feel free to reopen or create a new issue.

msteed avatar Jul 14 '15 21:07 msteed