How to disable a weak ssh cipher,100% working tested on Fedora 29.
The problem:
Nessus report my samba4 server use not strong ciphers aes256-cbc and aes128-cbc.
So I put those lines in /etc/ssh/sshd_config
MACs hmac-sha2-512,hmac-sha2-256
Ciphers aes256-ctr,aes192-ctr,aes128-ctr
KexAlgorithms diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,curve25519-sha256,[email protected]
Et voilà!..it still use the cbc cipher because this command work :(
ssh -c aes256-cbc samba4
So I check the useful systemd and I discover sshd service is using another file for ciphers
/etc/crypto-policies/back-ends/opensshserver.config
Backup the file for safety
cp /etc/crypto-policies/back-ends/opensshserver.config /etc/crypto-policies/back-ends/opensshserver.config.old
Edit it,and remove the cbc cipher.
Restart the service
systemctl restart sshd
And finally test,works fine..cbc disabled.
ssh -c aes256-cbc samba4
Unable to negotiate with 192.168.0.48 port 22: no matching cipher found. Their offer: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr