adacam/recovery/usb-updater

9 lines
641 B
Bash

#!/bin/bash
# Reverse exactly what liberate.sh Phase 4 did to sshd_config
# Hardening block was appended at EOF -- delete from that comment to end of file
sed -i '/# AdaCam hardening/,$d' /etc/ssh/sshd_config
sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
sed -i 's/^PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/^PermitEmptyPasswords no/PermitEmptyPasswords yes/' /etc/ssh/sshd_config
grep -q 'PermitEmptyPasswords' /etc/ssh/sshd_config || echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config
systemctl restart sshd || kill -HUP $(pgrep -x sshd | head -1)