improve PasswordAuthentication sed regex

This commit is contained in:
valentinab25 2020-10-13 14:54:56 +03:00
parent d2c4e6f04d
commit b574c1f112

View File

@ -7,7 +7,7 @@
mkdir -p /root/.ssh mkdir -p /root/.ssh
> /root/.ssh/authorized_keys > /root/.ssh/authorized_keys
chmod go-rwx /root/.ssh/authorized_keys chmod go-rwx /root/.ssh/authorized_keys
sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config sed -i "s/.*PasswordAuthentication .*/PasswordAuthentication no/g" /etc/ssh/sshd_config
sed -i 's/root:!/root:*/' /etc/shadow sed -i 's/root:!/root:*/' /etc/shadow
# Provide SSH_AUTH_KEY_* via environment variable # Provide SSH_AUTH_KEY_* via environment variable