How can I determine the supported MACs, Ciphers, Key length and KexAlogrithms supported by my ssh servers?
I need to create a list for an external security audit. I'm looking for something similar to openssl s_client -connect example.com:443 -showcerts
. From my research the ssh
uses the default ciphers as listed in man sshd_config
. However I need a solution I can use in a script and . I need to correct myself here: You can specify man sshd_config
does not list information about key lengthServerKeyBits
in sshd_config
.
I guess that ssh -vv localhost &> ssh_connection_specs.out
returns the information I need but I'm not sure if the listed ciphers are the ciphers supported the client or by the server. Also I'm not sure how to run this non interactive in a script.
Is there a convenient way to get SSH
connection information?
sshd -T | grep "\(ciphers\|macs\|kexalgorithms\)"
as suggested by @Jakuje works only on RHEL7 hosts, but not RHEL6. I ended up usingnmap --script SSH2-hostkey localhost
andnmap --script ssh-hostkey localhost
– Henrik Pingel Nov 11 '15 at 9:48ssh -vv
outputs the supported functionality as client to server (ctos) and server to client (stoc). However, it seems that those outputs are limited to what both sides support, making them less useful for a security audit. – Moshe Dec 19 '19 at 18:21