This commit is contained in:
2023-12-22 20:11:54 -06:00
parent 52142bfbaf
commit b56cd464eb
+4 -4
View File
@@ -24,13 +24,13 @@ fi
isInFile=$(cat /etc/hostname | grep -c "proxmox") isInFile=$(cat /etc/hostname | grep -c "proxmox")
if [ $isInFile -eq 0 ] if [ $isInFile -eq 0 ]
then then
isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PasswordAuthentication no") # isInFile=$(cat /etc/ssh/sshd_config | grep -c "#PasswordAuthentication no")
if [ $isInFile -eq 0 ] # if [ $isInFile -eq 0 ]
then # then
sed -i 's/#PasswordAuthentication no/PasswordAuthentication no/g' /etc/ssh/sshd_config sed -i 's/#PasswordAuthentication no/PasswordAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
fi # fi
fi fi