restrict install to a single user
This commit is contained in:
parent
a5ea5c2350
commit
e175d088aa
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# NOTE: %1 is the user being authorized. However, we'll make this only for
|
||||||
|
# the primary user
|
||||||
|
|
||||||
# Accomodate for local install
|
# Accomodate for local install
|
||||||
PATH=$HOME/.local/bin:$PATH
|
PATH=$HOME/.local/bin:$PATH
|
||||||
|
|
||||||
|
|
8
makeitso
8
makeitso
|
@ -1,8 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo 'usage: makeitso <primaryusername>' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser
|
sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser
|
||||||
|
|
||||||
sudo sh -c "echo 'AuthorizedKeysCommand /etc/ssh/get_authorized_keys
|
sudo sh -c "echo 'Match User $1
|
||||||
|
AuthorizedKeysCommand /etc/ssh/get_authorized_keys
|
||||||
AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config"
|
AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config"
|
||||||
|
|
||||||
sudo cp authorized_keys /etc/ssh
|
sudo cp authorized_keys /etc/ssh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user