fixes
This commit is contained in:
7
app/hardening
Executable file
7
app/hardening
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# DISABLE ROOT and PASSWORD LOGIN
|
||||
rex "doas sh -c 'grep -q \"permit nopass 4server as root\" /etc/doas.d/4server.conf 2>/dev/null || echo \"permit nopass 4server as root\" | tee -a /etc/doas.d/4server.conf > /dev/null'"
|
||||
rex "doas sh -c 'sed -i \"s/^#\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config'"
|
||||
|
||||
rex "doas sh -c 'sed -i \"s/^#\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config.d/50-cloud-init.conf'"
|
||||
rex doas rc-service sshd restart
|
||||
Reference in New Issue
Block a user