Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Missing newline broke sshd_config #121

Closed
laurikimmel opened this issue Apr 8, 2018 · 3 comments
Closed

Missing newline broke sshd_config #121

laurikimmel opened this issue Apr 8, 2018 · 3 comments
Labels

Comments

@laurikimmel
Copy link

Metadata:

  • Operating System: Debian 9.4 and 8.10
  • Installation method: install.sh script
  • AWS CLI Version: aws-cli/1.11.13 Python/3.5.3 Linux/4.9.0-6-amd64 botocore/1.4.70

Installation script broke sshd_config and service refused to start.
Installation script appended two new config statments to the /etc/ssh/sshd_config.
Apparently original config file was missing new line at the end and first new statement was appended to the last existing one

UseDNS noAuthorizedKeysCommand /opt/authorized_keys_command.sh
AuthorizedKeysCommandUser nobody

Although it was trivial to fix the config file it might render instance inaccessible.

  1. add extra new lines in install_configure_sshd.sh
  2. consider making backup from /etc/ssh/sshd_config before modifying it
  3. provide revert / uninstall script
@michaelwittig
Copy link
Contributor

First, Debian is not yet supported as documented in the README and therefore not save to use (as you proofed).

Question: Besides the issues #121 and #122 that you discovered when using Debian, anything else that needs to be adjusted? If not, I believe we can support Debian with minimal effort using the information you provided.

Which AMIs are you using?

@laurikimmel
Copy link
Author

I was aware about Debian not listed in supported OS list when I started.

OTOH missing newline at the end of file is not depending on the specific distro. By mistake or not - user might remove it, some script might remove it etc. To be on the safe side - it would be good to check and add one if necessary.

IMHO having a backup and uninstall script would make things bit more safe for any platform.

--

No other issues beside #121 and #122 seen on Debian so far.

Both instances started from ami-e079f893, regularly updated, one upgraded to Stretch.

@michaelwittig
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants