This commit is contained in:
2023-12-22 00:40:00 -06:00
parent a4522fd179
commit 965f517f79

View File

@@ -15,7 +15,9 @@ if [ $isInFile -eq 0 ]
if [ $isInFile -eq 0 ]
then
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak1
sed -i 's/PermitRootLogin no/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
sed -i 's/PermitRootLogin yes/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
sed -i 's/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
fi
fi
@@ -26,6 +28,8 @@ if [ $isInFile -eq 0 ]
if [ $isInFile -eq 0 ]
then
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak2
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
fi
fi