Correctly pipe the sshd check to /dev/null

This patch corrects the pipe of the sshd configuration check to
/dev/null. The script therefore no longer leaves a file called 'null'
behind on the deployment host.

Change-Id: Ib707d7462e5e444dddceff105b219263d0283e0c
Closes-Bug: #1401567
This commit is contained in:
Jesse Pretorius 2014-12-11 15:20:11 +00:00
parent 1f7ff33595
commit 6c7e170d98

View File

@ -43,7 +43,7 @@ iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Ensure that sshd permits root login, or ansible won't be able to connect
if grep "^PermitRootLogin" /etc/ssh/sshd_config > null; then
if grep "^PermitRootLogin" /etc/ssh/sshd_config > /dev/null; then
sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
else
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config