more specific grep pattern
This commit is contained in:
parent
9e8d93d4ea
commit
31b912b2c9
2
makeitso
2
makeitso
|
@ -10,7 +10,7 @@ if [ ! -d /home/authorizedkeysuser ]; then
|
||||||
sudo useradd -c 'User for AuthorizedKeysCommand' -d /home/authorizedkeysuser -m -s/usr/sbin/nologin authorizedkeysuser
|
sudo useradd -c 'User for AuthorizedKeysCommand' -d /home/authorizedkeysuser -m -s/usr/sbin/nologin authorizedkeysuser
|
||||||
fi
|
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
|
sudo sh -c "echo 'Match User $1
|
||||||
AuthorizedKeysCommand /etc/ssh/get_authorized_keys
|
AuthorizedKeysCommand /etc/ssh/get_authorized_keys
|
||||||
AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config"
|
AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user