Skip to content

Remove the OpenSSH Server Package

An XCCDF Rule

Description

The openssh-server package should be removed. The openssh-server package can be removed with the following command:

$ sudo yum erase openssh-server

Rationale

Without protection of the transmitted information, confidentiality, and integrity may be compromised because unprotected communications can be intercepted and either read or altered.

ID
xccdf_org.ssgproject.content_rule_package_openssh-server_removed
Severity
Medium
Updated



Remediation - Anaconda Pre-Install Instructions


package --remove=openssh-server

Remediation - Ansible

- name: Ensure openssh-server is removed
  package:
    name: openssh-server
    state: absent
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags:

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

# CAUTION: This remediation script will remove openssh-server
#	   from the system, and may remove any packages
#	   that depend on openssh-server. Execute this

Remediation - Puppet

include remove_openssh-server

class remove_openssh-server {
  package { 'openssh-server':
    ensure => 'purged',
  }