SV-268137r1131078_rule
V-268137
SRG-OS-000109-GPOS-00056
ANIX-00-000890
CAT II
10
Configure NixOS to ensure the root user login via SSH is disabled.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
services.openssh.permitRootLogin = "no";
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify the NixOS configuration disallows directly logging into the root account via SSH with the following command:
$ grep PermitRootLogin /etc/ssh/sshd_config
PermitRootLogin no
If the value is anything other than "no", this is a finding.
V-268137
False
ANIX-00-000890
Verify the NixOS configuration disallows directly logging into the root account via SSH with the following command:
$ grep PermitRootLogin /etc/ssh/sshd_config
PermitRootLogin no
If the value is anything other than "no", this is a finding.
M
5658