Add public key to authorized_keys

This commit is contained in:
Anton Volnuhin 2023-05-28 18:36:40 +03:00
parent d0d61fe69a
commit 5f0c933f37
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
BASE_PACKAGES="kitty-terminfo gpg git curl wget ripgrep fd-find unzip python3-pip htop fzf bat"
BASE_PACKAGES="kitty-terminfo gpg git curl wget ripgrep fd-find unzip python3-pip htop fzf bat awk"
USER=$(whoami)
Green='\033[0;32m' # Green
NC='\033[0m' # No Color

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.old 2>/dev/null || true
##print only unique lines
cat ~/.ssh/authorized_keys.old <(echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdqIDeRKDOh7NQDcqnmLH/6M0ys7Wt/SEnF6ZYqroiH") 2>/dev/null | awk '!seen[$1]++' > ~/.ssh/authorized_keys