added check for pub key
This commit is contained in:
8
debian/debian-configure-sshd.sh
vendored
8
debian/debian-configure-sshd.sh
vendored
@@ -25,3 +25,11 @@ if [ $isInFile -eq 0 ]
|
||||
sed s/#PasswordAuthentication yes/PasswordAuthentication no/g > /etc/ssh/sshd_config
|
||||
fi
|
||||
fi
|
||||
|
||||
isInFile=$(cat /etc/hostname | grep -c "rsnapshotbackup")
|
||||
if [ $isInFile -eq 0 ]
|
||||
then
|
||||
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKZ2vuz72vLxq5+iNQopIK19d0Y4TE3eExy9KRiNlAgk rsnapshotbackup" >> /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user