Linux distributions
CIS-UBUNTU-5.2.8
Ensure SSH root login is disabled
CaoCấp 1Tự độnglinux
Mô tả
The PermitRootLogin parameter specifies if the root user can log in using ssh.
Cách kiểm tra
Phương pháp kiểm tra: Mẫu tệp
- Tệp
/etc/ssh/sshd_config- Mẫu khớp
(?m)^\s*PermitRootLogin\s+no\b
Cách khắc phục
Phương pháp khắc phục: Lệnh shell
shell
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_configThuộc tính
- Hệ điều hành
- ubuntu-22.04, ubuntu-24.04, rocky-9
- Thẻ
- sshserver
- Tham chiếu
- CIS Ubuntu Linux / Rocky Linux Benchmarks - Ensure sshd PermitRootLogin is disabled (verify section number for your release)
Kiểm tra máy này
Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.
shell
tmaegis scan --target linux