Skip to Content

Check Supported MAC Algorithms in SSH Client and Server

Secure Shell (SSH) is a cryptographic network protocol that plays a vital role in secure data communication, remote command-line login, and remote command execution.

One of the core components of SSH’s security model is its use of Message Authentication Code (MAC) algorithms. MAC algorithms ensure data integrity and authenticity between the SSH client and server.

As cyber threats evolve, so do MAC algorithms, with some becoming obsolete or considered less secure over time.

Therefore, it’s crucial for system administrators and security professionals to regularly check and be aware of the MAC algorithms supported by their SSH client and server.

This not only ensures optimal data security but also aids in compliance with security standards and best practices.

In this guide, we’ll delve into how to check the supported MAC algorithms in your SSH setup and why it’s essential for maintaining a fortified SSH environment.

Checking Supported MAC Algorithms in SSH Client and Server

To check the MAC (Message Authentication Code) algorithms supported by your SSH client or server, you can use the `ssh` command for the client and the `sshd` command for the server. Here’s how to do it:

1. SSH Client: To see the MAC algorithms that the SSH client supports:

ssh -Q mac

This is the output in my environment.

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

2. SSH Server: To see the MAC algorithms that the SSH server (`sshd`) supports:

sshd -T | grep macs

Alternatively, you can use:

sshd -T | grep -i macs


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

This command will display the current MACs configuration from `sshd_config`. If you haven’t specifically set this, it will display the defaults.

After running these commands, you’ll get a list of supported MAC algorithms. You can then compare and configure both the client and the server to ensure they have common algorithms for a successful connection.