update process for public authorized_keys

This commit is contained in:
Emil Lerch 2021-07-16 09:48:14 -07:00
parent b870537f47
commit 6c25bb5edd
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
3 changed files with 3 additions and 23 deletions

View File

@ -2,9 +2,6 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoRxIS1Dr33Jhybd/ck7UCLQ1Df5msSpvw03w/ljgB+1sx/U+965+q597XRHHnzPey8NFrOdID4I1l0tfco1XG5DJG2yJ/zY+tbyK+0b0Yi4qbRFnH2kxKYcdHq29CiVk64o1VHJxxj78IO2wTUcgK4sXijm05LWqCik4LSfcOBEyOwK6f37Mew19KDq7UAojHLTEbVB6xiv2ufh9evn3PggirE1VtvQlTBnt3NdBDumxD1RzRoVgwMuU1FNvQeMwLnlMlvLX76vjPkRRrgBGEJ2k0BUm7slrAtRnBzIvIbouk55MIBzpPjCIi53L91KxwNkHNPldYG81C+BczN/R5 cardno:000604717732
# Chromebook (GalliumOS)
#ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICIhbaWDDxwSn83MXmDes0ikUeighhfM/po1RPYYHDN lobo@chromebook
# Gallium - Chromebook running GalliumOS
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDxUNqjpukVhDXJnicD0dOhMMaQPOqYgPR14NSUd9rLp lobo@gallium
# Home server

View File

@ -1,21 +1,3 @@
#!/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
# This is much slower than hitting DDB, so while it will work, we'll use
# our codecommit -> DDB lambda function and pull direct from DDB. Also helps
# with codecommit user count...
# aws codecommit get-file \
# --repository-name authorized_keys \
# --file-path authorized_keys \
# --query 'fileContent' \
# --cli-read-timeout 1 \
# --cli-connect-timeout 1 \
# --output text |base64 -d
aws dynamodb scan --table-name key --query 'Items[0].key.S' --output text
curl -s https://emil.lerch.org/authorized_keys

View File

@ -5,7 +5,8 @@ if [ $# -ne 1 ]; then
exit 1
fi
sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser
#sudo adduser --disabled-login --gecos 'User for AuthorizedKeysCommand' authorizedkeysuser ||
sudo useradd -c 'User for AuthorizedKeysCommand' -d /home/authorizedkeysuser -m -s/usr/sbin/nologin authorizedkeysuser
sudo sh -c "echo 'Match User $1
AuthorizedKeysCommand /etc/ssh/get_authorized_keys