Add rm known hosts file to fix SFTP behaviour after key change

This commit is contained in:
2026-01-09 22:27:51 -05:00
parent 7a79c716bc
commit 8b50f0046a

View File

@@ -27,6 +27,8 @@ sleep 2
rm -rf /.SSH/automated/.temp/
##Attribute to self & restart sshd
rm /home/$USER/.ssh/known_hosts
rm /root/.ssh/known_hosts
cat /.SSH/automated/priv/servers/id_ed25519 | tee /root/.ssh/id_ed25519
cat /.SSH/automated/pub/servers/id_ed25519.pub | tee /root/.ssh/authorized_keys &&
chmod 700 /root/.ssh/id_ed25519