diff --git a/get_authorized_keys b/get_authorized_keys index a05d106..d3d68b1 100755 --- a/get_authorized_keys +++ b/get_authorized_keys @@ -1,5 +1,8 @@ #!/bin/sh +# NOTE: %1 is the user being authorized. However, we'll make this only for +# the primary user + # Accomodate for local install PATH=$HOME/.local/bin:$PATH diff --git a/makeitso b/makeitso index 81e55a1..7ada939 100755 --- a/makeitso +++ b/makeitso @@ -1,9 +1,15 @@ #!/bin/sh +if [ $# -ne 1 ]; then + echo 'usage: makeitso ' >&2 + exit 1 +fi + sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser -sudo sh -c "echo 'AuthorizedKeysCommand /etc/ssh/get_authorized_keys -AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config" +sudo sh -c "echo 'Match User $1 + AuthorizedKeysCommand /etc/ssh/get_authorized_keys + AuthorizedKeysCommandUser authorizedkeysuser' >> /etc/ssh/sshd_config" sudo cp authorized_keys /etc/ssh