more specific grep pattern

This commit is contained in:
Emil Lerch 2021-07-16 10:05:29 -07:00
parent 9e8d93d4ea
commit 31b912b2c9
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -10,7 +10,7 @@ if [ ! -d /home/authorizedkeysuser ]; then
sudo useradd -c 'User for AuthorizedKeysCommand' -d /home/authorizedkeysuser -m -s/usr/sbin/nologin authorizedkeysuser
fi
grep -q AuthorizedKeysCommand /etc/ssh/sshd_config || \
grep -qF 'AuthorizedKeysCommand /etc/ssh/get_authorized_keys' /etc/ssh/sshd_config || \
sudo sh -c "echo 'Match User $1
AuthorizedKeysCommand /etc/ssh/get_authorized_keys
AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config"