11

I have a new (first time) CentOS 6.5 server being used for a web server. Our security team has identified the following weakness:

The SSH server is configured to allow either MD5 or 96-bit MAC algorithms, both of which are considered weak. 

Note that this plugin only checks for the options of the SSH server and does not check for vulnerable software versions.

Plugin Output
The following client-to-server Method Authentication Code (MAC) algorithms 
are supported : 

 hmac-md5 
 hmac-md5-96 
 hmac-sha1-96

How do I disable MD5 and/or 96-bit MAC algorithms on a CentOS 6.5 server? I tried running: authconfig --disablemd5 --updateall but still had the same issue.

5
  • 3
  • Okay - the serverfault one is on hold, so let's keep this one. For future reference, please do not cross post.
    – Rory Alsop
    Dec 29, 2013 at 17:27
  • Well, you can use certificate authorization. it will be much more secure than password.
    – user40687
    Feb 27, 2014 at 7:38
  • Relevant: Secure Secure Shell
    – user
    Mar 30, 2016 at 14:54
  • Doesn't removing the entries stop presentation of the ciphers during the negotiation period?
    – munchkin
    Jan 18, 2017 at 10:38

4 Answers 4

11

I am not completely sure, but you may want to look at the protocol setting in sshd_config.

From http://wiki.centos.org/HowTos/Network/SecuringSSH

# Protocol 2,1
Protocol 2

Change Protocol 1 to Protocol 2 and restart. This should already be set to Protocol 2 in Centos 6.5, but you may want to double check.

I found this run down of the different protocol options

http://www.snailbook.com/faq/ssh-1-vs-2.auto.html

Not sure if that is going to be enough to solve your particular issue though.

Do you know what they are using to check the configuration?

UPDATED:

This is from running man sshd_config on

Ciphers
         Specifies the ciphers allowed for protocol version 2 in order of preference.  Multiple ciphers must be comma-separated.  The supported ciphers are
         “3des-cbc”, “aes128-cbc”, “aes192-cbc”, “aes256-cbc”, “aes128-ctr”, “aes192-ctr”, “aes256-ctr”, “arcfour128”, “arcfour256”, “arcfour”,
         “blowfish-cbc”, and “cast128-cbc”.  The default is:

            aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
            aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
            aes256-cbc,arcfour

Also the Macs option:

MACs    Specifies the MAC (message authentication code) algorithms in order of preference.  The MAC algorithm is used in protocol version 2 for data
         integrity protection.  Multiple algorithms must be comma-separated.  The default is:

               hmac-md5,hmac-sha1,[email protected],
               hmac-ripemd160,hmac-sha1-96,hmac-md5-96,
               hmac-sha2-256,hmac-sha2-512

So I would take a look through those and set the options in your /etc/ssh/sshd_config file with the ciphers and macs that you want.

3
  • I believe the tool is called Nessus or Tenable Security Scanner.
    – user739866
    Dec 26, 2013 at 3:36
  • 1
    That is actually a pretty good scanner.
    – Casey
    Dec 26, 2013 at 17:01
  • 1
    Changing to explicit Protocol 2 didn't work for me, I had to specify the Ciphers and MACs list (also as a result of a Nessus external scan).
    – dsummersl
    Apr 21, 2014 at 14:50
7

Add the following 2 lines to your /etc/ssh/ssh_config and the /etc/ssh/sshd_config file:

Ciphers aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-cbc
MACs hmac-sha1

Restart services. Boom. FIPS compliant.

3
  • I'm pretty sure OpenSSH isn't certified as FIPS compliant. You might be using FIPS algorithms, but that doesn't mean you are FIPS compliant.
    – user
    Jan 18, 2017 at 16:08
  • @MichaelKjörling: people talking about 'FIPS compliant/compliance' usually mean FIPS140 validated, but read literally OpenSSH does comply with FIPS197 FIPS46-3 (even though withdrawn) FIPS198-1 FIPS180. Somewhat more seriously, most OpenSSH builds (still) use OpenSSL for crypto primitives and OpenSSL can optionally be built to use an internal FIPS140 module that is validated on some platforms; the exact list has changed repeatedly so check the links at openssl.org/docs/fips.html Jan 18, 2017 at 18:41
  • Prefix the Ciphers in the list with + and - instead of hardcoding a list that will make future configurations less secure than they could be by default. Nov 20, 2018 at 9:13
7

It's 2017 and it's time to update the recommendations. Now both all *-CBC and RC4 ciphers are considered weak. So we are left with:

MACs hmac-sha2-512,hmac-sha2-256
Ciphers aes256-ctr,aes192-ctr,aes128-ctr

Or for anything newer that supports OpenSSH 6.7 and above:

Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr

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

Source: https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Configuration

1
  • 1
    Thank you - I had to re-add hmac-sha1 to the MACs line, but otherwise this fixed my needs
    – Criggie
    May 8, 2017 at 5:07
0

I found this post that may be helpful. It states that by adding the following lines:

 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128
 MACs hmac-sha1,[email protected],hmac-ripemd160

to the sshd config (/etc/ssh/sshd_config) you can remove these weak MACs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .