4

I am trying to disable any weak ciphers/algorithms in my ec2 instances. And I have added following lines in the /etc/ssh/sshd_config

... Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour MACs hmac-sha1,[email protected],hmac-ripemd160,hmac-sha2-256,hmac-sha2-512,[email protected] ... 

And when I try to restart the sshd service, it is not re-starting properly. So I did;

sshd -t 

And I got the following error:

Bad SSH2 mac spec 'hmac-sha1,[email protected],hmac-ripemd160,hmac-sha2-256,hmac-sha2-512,[email protected]'

Can somehelp help me how to fix this?

The sshd version is OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021

1 Answer 1

5

Support for the RIPE-MD160 HMAC algorithm was removed from OpenSSH in 2017 in the 7.6 release so you might want to check the publication date and how old the source is to support your decision on what algorithms you want to include.

According to the manual man sshd_config the list of available MAC algorithms can be obtained using ssh -Q mac.

Make a selection from those.

The now defunct cypherli.st recommended the following as strong MAC algorithms:

MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,[email protected] 

and other settings:

KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256 Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr 

But you might want to confirm those as well.

4
  • Is there a way I can identify if my MACs or Ciphers are weak or strong? Commented Mar 21, 2022 at 10:20
  • OpenSSH defaults are tuned for compatibility, using settings that are still considered secure for general purposes but they also do not limit clients to use only the "best" cryptographic security. Generally elliptic curves, AES are considered good and longer keys are better than shorter. Cryptography is an ever evolving field of studies and what is considered weak and strong also evolves with research and scientific breakthroughs. That is better discussed at security.stackexchange.com - Also: serverfault.com/help/someone-answers Commented Mar 21, 2022 at 10:33
  • This worked great - listing the mac algorithms with ssh -Q mac showed the configured hmac-ripemd169 was missing for me. Commented Jun 27, 2022 at 14:19
  • 1
    no ssh -Q option with version OpenSSH_5.5p1 Debian-6+squeeze8, OpenSSL 0.9.8o 01 Jun 2010 Commented Nov 17, 2023 at 23:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.