Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SSH password auth #53

Closed
mysticaltech opened this issue Feb 9, 2022 · 3 comments
Closed

Remove SSH password auth #53

mysticaltech opened this issue Feb 9, 2022 · 3 comments

Comments

@mysticaltech
Copy link
Collaborator

We need to remove SSH password auth ideally through ignition, but if not possible, through combustion. And also do some basic hardening of that service if needed.

First and foremost, we need to find the location of the SSH config file.

@mysticaltech
Copy link
Collaborator Author

It's located at /usr/etc/ssh/sshd_config

@mysticaltech
Copy link
Collaborator Author

mysticaltech commented Feb 9, 2022

Thinking issuing these commands via a combustion script:

sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /usr/etc/ssh/sshd_config
sed -i -e '/^X11Forwarding/s/^.*$/X11Forwarding no/' /usr/etc/ssh/sshd_config
sed -i -e '/^#MaxAuthTries/s/^.*$/MaxAuthTries 2/' /usr/etc/ssh/sshd_config
sed -i -e '/^#AllowTcpForwarding/s/^.*$/AllowTcpForwarding no/' /usr/etc/ssh/sshd_config
sed -i -e '/^#AllowAgentForwarding/s/^.*$/AllowAgentForwarding no/' /usr/etc/ssh/sshd_config
sed -i -e '/^#AuthorizedKeysFile/s/^.*$/AuthorizedKeysFile .ssh\/authorized_keys/' /usr/etc/ssh/sshd_config

@mysticaltech
Copy link
Collaborator Author

Now all is good, finally just did it via good old ignition!

ksnip_20220210-033713

No more funny business going on in here:

ksnip_20220210-033533

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

No branches or pull requests

1 participant