Re: changing the default location for authorized_keys

Originally Posted by
Lars Noodén
The default is for sshd to look for %h/.ssh/authorized_keys, where %h is converted to the user's home directory. But that file won't be available until a successful login makes the encrypted directory available, and that is not possible until the authorized_keys file is read and used for login. The user's login name can be abbreviated in sshd_config using
%u.
In sshd_config:
Code:
AuthorizedKeysFile /var/openssh/%u/.ssh/authorized_keys
One way to prep the new locations below. It might be a good idea to leave a note in the usual default location pointing to the new location, just as a form of insurance in case people forget where to put their keys.
Code:
#
sudo mkdir -m 0700 -p /var/openssh/fred/.ssh/
#
sudo touch /var/openssh/fred/.ssh/authorized_keys
#
sudo chmod 0600 /var/openssh/fred/.ssh/authorized_keys
#
sudo chown -R fred:fred /var/openssh/fred/
+1 I just discovered this by accident. Obviously it makes sense, that in order to read the public key, first the encrypted directory containing the public key must be decrypted.
Thanks for the solution.
Laptop: CPU: Intel i5 430m RAM: 4gb DDR3 GPU: Ethernet: Broadcom BCM57780 WiFi: Atheros AR928X
Desktop:
Bookmarks