Allow Only SSH Protocol 2
An XCCDF Rule
Description
Only SSH protocol version 2 connections should be
permitted. The default setting in
/etc/ssh/sshd_config
is correct, and can be
verified by ensuring that the following
line appears:
Protocol 2
warning alert: Warning
As of
openssh-server
version 7.4
and above, the only protocol
supported is version 2, and line Protocol 2in
/etc/ssh/sshd_config
is not necessary.Rationale
SSH protocol version 1 is an insecure implementation of the SSH protocol and has many well-known vulnerability exploits. Exploits of the SSH daemon could provide immediate root access to the system.
- ID
- xccdf_org.ssgproject.content_rule_sshd_allow_only_protocol2
- Severity
- High
- References
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
if [ -e "/etc/ssh/sshd_config" ] ; then
LC_ALL=C sed -i "/^\s*Protocol\s\+/Id" "/etc/ssh/sshd_config"
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-80894-9
- CJIS-5.5.6