Adding final ESXI deployment code
This commit is contained in:
20
ESXi/Packer/_common/sshd.sh
Normal file
20
ESXi/Packer/_common/sshd.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh -eux
|
||||
|
||||
SSHD_CONFIG="/etc/ssh/sshd_config"
|
||||
|
||||
# ensure that there is a trailing newline before attempting to concatenate
|
||||
sed -i -e '$a\' "$SSHD_CONFIG"
|
||||
|
||||
USEDNS="UseDNS no"
|
||||
if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then
|
||||
sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG"
|
||||
else
|
||||
echo "$USEDNS" >>"$SSHD_CONFIG"
|
||||
fi
|
||||
|
||||
GSSAPI="GSSAPIAuthentication no"
|
||||
if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then
|
||||
sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG"
|
||||
else
|
||||
echo "$GSSAPI" >>"$SSHD_CONFIG"
|
||||
fi
|
||||
Reference in New Issue
Block a user