From 8f3035ac1090726fec43486d835f4753b641670d Mon Sep 17 00:00:00 2001 From: akanealw Date: Tue, 19 Dec 2023 21:12:46 -0600 Subject: [PATCH] copied test script back to here --- debian/debian-configure-sshd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/debian-configure-sshd.sh b/debian/debian-configure-sshd.sh index 04a0659..a27951e 100644 --- a/debian/debian-configure-sshd.sh +++ b/debian/debian-configure-sshd.sh @@ -12,7 +12,7 @@ if [ $isInFile -eq 0 ] isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PermitRootLogin prohibit-password") if [ $isInFile -eq 0 ] then - sed s/PermitRootLogin yes/#PermitRootLogin prohibit-password/g > /etc/ssh/sshd_config + sed -i 's/PermitRootLogin yes/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config fi fi @@ -22,11 +22,11 @@ if [ $isInFile -eq 0 ] isInFile=$(cat /etc/ssh/sshd_config | grep -c "PasswordAuthentication no") if [ $isInFile -eq 0 ] then - sed s/#PasswordAuthentication yes/PasswordAuthentication no/g > /etc/ssh/sshd_config + sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config fi fi -isInFile=$(cat /etc/hostname | grep -c "rsnapshotbackup") +isInFile=$(cat /root/.ssh/authorized_keys | grep -c "rsnapshotbackup") if [ $isInFile -eq 0 ] then echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKZ2vuz72vLxq5+iNQopIK19d0Y4TE3eExy9KRiNlAgk rsnapshotbackup" >> /root/.ssh/authorized_keys