This cookbook configures basic security settings for a new server.
- It disables root access.
- It disables password authentication.
- It disables PAM.
This cookbook is based in part on https://github.com/gchef/ssh-cookbook.git
.
This cookbook is only tested on Ubuntu.
Include this cookbook in your Berksfile
.
cookbook 'ssh', git: 'aerogami-cookbooks/ssh'
Install the cookbook.
berks install
Add to your chef kitchen and use as desired.
Change the SSH port especially if you are not using something like fail2ban; be warned that security by obscurity is not security.
default[:ssh][:port] = '22'
You should disable root login.
default[:ssh][:permit_root_login] = 'no'
You should also disable password login.
default[:ssh][:password_authentication] = 'no'
default[:ssh][:use_pam] = 'no'
default[:ssh][:challenge_response_authentication] = 'no'
This is probably default behaviour on most distros.
default[:ssh][:permit_empty_passwords] = 'no'
Mohamad El-Husseini