gh2o / digitalocean-debian-to-arch

Script to convert a Debian installation on DigitalOcean to Arch Linux
MIT License
830 stars 69 forks source link

Check AuthorizedKeysFile in sshd_config #50

Closed injust closed 6 years ago

injust commented 7 years ago

No need to write SSH public keys into the default location if the user has overridden the location in /etc/sshd_config

gh2o commented 7 years ago

Thanks for the PR. I like the idea, but it could become problematic because the AuthorizedKeysFile may take multiple arguments, one of which may be .ssh/authorized_keys. Predictably handling all the edge cases, in addition to properly parsing the config and all of its edge cases, may be difficult; I would prefer to retain predictable behavior: the droplet's configured SSH key is always inserted into /root/.ssh/authorized_keys.

If you want to nullify the key, you can comment it out in authorized_keys with #.

injust commented 7 years ago

@gh2o I've modified the check to make sure it works with multiple instances of AuthorizedKeysFile and also multiple arguments. Could you please take another look?

gh2o commented 7 years ago

@Injust Thanks for the changes, but I'm curious: what problem are you solving with this PR?

injust commented 7 years ago

It isn't a problem, so to speak, but I've relocated the authorized_keys file and would like to get rid of the .ssh directory if it isn't necessary anymore.

injust commented 6 years ago

Closing for inactivity.