Last active
April 16, 2025 13:37
-
-
Save latuminggi/491b4433ca3c787633321f83c37d6d3d to your computer and use it in GitHub Desktop.
Disable weak SSH ciphers in Linux
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
### Disable weak SSH ciphers in Linux ### | |
# check ssh ciphers, macs, and kexalgorithms | |
sshd -T | grep "\(ciphers\|macs\|kexalgorithms\)" | |
# edit sshd_config | |
nano /etc/ssh/sshd_config | |
# add following conf lines into most bottom of sshd_config file | |
Ciphers [email protected],[email protected],aes256-ctr,aes128-ctr | |
MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-sha1 | |
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 | |
# or use these following lines | |
Ciphers aes256-ctr,aes128-ctr | |
MACs hmac-sha2-512,hmac-sha2-256,hmac-sha1 | |
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 | |
# restart ssh | |
service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment