recovery: precise SSH revert -- delete AdaCam hardening block, restore factory state

This commit is contained in:
kayos 2026-03-15 09:30:02 -07:00
parent eb4a65388e
commit 571dd89e17

View file

@ -1,4 +1,9 @@
#!/bin/bash
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
systemctl restart sshd || kill -HUP $(pgrep sshd)
# 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)