6.2.3 Set Permissions on /etc/ssh/sshd_config

Information

The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root.

Rationale:

The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs.

Solution

Run the following command to change the user and group ownership of /etc/ssh/sshd_config to the root user:

# chown root:root /etc/ssh/sshd_config

Run the following command to remove excess permissions from /etc/ssd/sshd_config:

# chmod u-x,go-wx 644 /etc/ssh/sshd_config

Default Value:

OS Default: Yes

See Also

https://workbench.cisecurity.org/files/3096