canonical / charm-userdir-ldap

A charm to install and configured userdir-ldap
Other
0 stars 4 forks source link

/etc/ssh/sshd_config changed before new keys imported #2

Open sudeephb opened 9 months ago

sudeephb commented 9 months ago

I had a failed deployment of userdir-ldap result in loss of connection to an entire cloud. This seemed to be caused by userdir-ldap modifying /etc/ssh/sshd_config to ignore ~/.ssh/authorized_keys in favor of /etc/ssh/user-authorized-keys/%u and /var/lib/misc/userkeys/%u. This is fine, except the installation failed due to an issue with my fdqn, resulting in an inability to ssh to the cloud because nothing existed in /etc/ssh/user-authorized-keys/ or /var/lib/misc/userkeys/.

This charm should probably import the ldap keys and have them available before modifying /etc/ssh/sshd_config to prevent this edge case.


Imported from Launchpad using lp2gh.

sudeephb commented 9 months ago

(by vultaire) This occurred on another cloud.

The "local" userdir-ldap procedure was run on the first infra, so access still worked there since keys were installed to the expected locations. However, the /etc/ssh/sshd_config changes on the other 2 infras broke access since keys weren't in the /etc/ssh/user-authorized-keys/ nor /var/lib/misc/userkeys/ locations.