feat: Adds import script.
This commit is contained in:
25
import
Executable file
25
import
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Imports public gpg key that's stored on a yubikey, set's the trust settings, and
|
||||
# copies the ssh key. This is only needed to be done once on a new machine.
|
||||
|
||||
KEYID="90D3EB6274D5B7CF"
|
||||
SSH_FILE="~/.ssh/id_ed25519_sk.pub"
|
||||
|
||||
# Import the public key
|
||||
gpg --import 90D3EB6274D5B7CF-2025-03-29.asc
|
||||
|
||||
# Set trust settings to ultimate for gpg key.
|
||||
gpg --command-fd=0 --pinentry-mode=loopback --edit-key $KEYID <<EOF
|
||||
trust
|
||||
5
|
||||
y
|
||||
save
|
||||
EOF
|
||||
|
||||
# Add public ssh key
|
||||
if [ ! -f $SSH_FILE ]; then
|
||||
mkdir ~/.ssh
|
||||
ssh-add -L | grep "cardno:31_790_263" >$SSH_FILE
|
||||
chmod 600 $SSH_FILE
|
||||
fi
|
||||
Reference in New Issue
Block a user