-
-
Save ksanchezcld/163f05bd37daad1509f5f3e2bba2095b to your computer and use it in GitHub Desktop.
sshd_config hardening
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Insert these at the beginning of an existing sshd_config file | |
| KexAlgorithms curve25519-sha256@libssh.org | |
| Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr | |
| MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com | |
| Protocol 2 | |
| HostKey /etc/ssh/ssh_host_ed25519_key | |
| HostKey /etc/ssh/ssh_host_rsa_key | |
| PasswordAuthentication no | |
| ChallengeResponseAuthentication no | |
| PubkeyAuthentication yes | |
| # Optional group restriction: | |
| # AllowGroups groupname | |
| # If using Tor hidden services: | |
| # ListenAddress 127.0.0.1:22 | |
| # | |
| # Also add this to /etc/tor/torrc | |
| # HiddenServiceDir /var/lib/tor/hidden_service/ssh | |
| # HiddenServicePort 22 127.0.0.1:22 | |
| # Generate server keys: | |
| # cd /etc/ssh | |
| # rm ssh_host_*key* | |
| # ssh-keygen -t ed25519 -f ssh_host_ed25519_key < /dev/null | |
| # ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment