recovery: precise SSH revert -- delete AdaCam hardening block, restore factory state
This commit is contained in:
parent
eb4a65388e
commit
571dd89e17
1 changed files with 8 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue