try to use sed instead

This commit is contained in:
Louis Abel 2024-05-04 14:43:15 -07:00
parent a69d82eb8c
commit c6754418db
Signed by untrusted user: label
GPG Key ID: 2A6975660E424560

View File

@ -603,12 +603,8 @@ Defaults:vagrant !requiretty
EOF
chmod 0440 /etc/sudoers.d/vagrant
# This may have to be changed for 10
ex -s /etc/ssh/sshd_config <<EOF
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
:update
:quit
EOF
sed -i 's/^\(PasswordAuthentication\) yes$/\1 no/' /etc/ssh/sshd_config
sed -i 's/^#\(UseDNS\) yes$/\r\1 no/' /etc/ssh/sshd_config
cat >>/etc/sysconfig/sshd <<EOF
# Decrease connection time by preventing reverse DNS lookups