This commit is contained in:
Bob Mottram 2017-06-28 13:35:34 +01:00
parent c5a9c6707d
commit d235c8dbe4
1 changed files with 3 additions and 4 deletions

View File

@ -40,12 +40,11 @@ function configure_ssh {
if [[ $(is_completed $FUNCNAME) == "1" ]]; then
return
fi
if ! grep 'HostbasedAuthentication' /etc/ssh/sshd_config; then
if ! grep -q 'HostbasedAuthentication' /etc/ssh/sshd_config; then
echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config
else
sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
fi
sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|#PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
sed -i 's|PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config