SV-268159r1131124_rule
V-268159
SRG-OS-000423-GPOS-00187
ANIX-00-001620
CAT I
10
Configure NixOS to enable sshd for remote access.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
services.sshd.enable = true;
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS enables sshd for remote access with the following command:
$ systemctl status sshd
sshd.service - SSH daemon
Loaded: loaded (/etc/systemd/system/sshd.service; enabled; present: enabled)
Active: active (running) since Sat 2022-06-04 02:51:43 UTC; 13min ago
If the sshd.service is not "active" and "running", this is a finding.
V-268159
False
ANIX-00-001620
Verify NixOS enables sshd for remote access with the following command:
$ systemctl status sshd
sshd.service - SSH daemon
Loaded: loaded (/etc/systemd/system/sshd.service; enabled; present: enabled)
Active: active (running) since Sat 2022-06-04 02:51:43 UTC; 13min ago
If the sshd.service is not "active" and "running", this is a finding.
M
5658