Port Modules/Security/secharden-ssh.sh. Deploys: - Authorized keys for root, localuser, subodev (conditional on existence) - Hardened /etc/ssh/sshd_config (skipped on dev workstations) - ssh-audit hardening drop-in for algorithm restrictions (skipped on Ubuntu where it breaks openssh-server) - Lockdown of sshd_config.d directory permissions SSH service is validated (sshd -t) before restart. 🤖 Generated with [Crush](https://github.com/charmassociates/crush) Assisted-by: GLM-5 via Crush <crush@charm.land>
21 lines
530 B
Plaintext
21 lines
530 B
Plaintext
Include /etc/ssh/sshd_config.d/*.conf
|
|
HostKey /etc/ssh/ssh_host_rsa_key
|
|
HostKey /etc/ssh/ssh_host_ed25519_key
|
|
KbdInteractiveAuthentication no
|
|
PrintMotd no
|
|
PasswordAuthentication no
|
|
AllowTcpForwarding no
|
|
X11Forwarding no
|
|
ChallengeResponseAuthentication no
|
|
AcceptEnv LANG LC_*
|
|
Subsystem sftp /usr/lib/openssh/sftp-server
|
|
UsePAM yes
|
|
Banner /etc/issue.net
|
|
MaxAuthTries 2
|
|
MaxStartups 10:30:100
|
|
PermitRootLogin prohibit-password
|
|
ClientAliveInterval 300
|
|
ClientAliveCountMax 3
|
|
AllowUsers root localuser subodev
|
|
LoginGraceTime 60
|