Update secrets and SSH to ed25519
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
# vim: set ft=bash:
|
||||
if [ ! -f "${HOME}/.ssh/id_rsa" ]; then
|
||||
file="${HOME}/.ssh/id_ed25519"
|
||||
if [ ! -f "${file}" ]; then
|
||||
echo "Generating a new key"
|
||||
ssh-keygen -t rsa -b 8192 -f "${HOME}/.ssh/id_rsa" -N ''
|
||||
cat "${HOME}/.ssh/id_rsa.pub" >> /etc/nixos/home/ssh/authorized_keys
|
||||
ssh-keygen -t ed25519 -f "${file}" -N ''
|
||||
cat "${file}.pub" >> /etc/nixos/home/ssh/authorized_keys
|
||||
|
||||
echo "Authing key to GitHub - may fail"
|
||||
gh auth refresh -h github.com -s admin:public_key
|
||||
gh ssh-key add -t ${HOSTNAME}-auto ~/.ssh/id_rsa.pub || true
|
||||
gh ssh-key add -t ${HOSTNAME}-auto "${file}" || true
|
||||
fi
|
||||
cp /etc/nixos/home/ssh/authorized_keys "${HOME}/.ssh/authorized_keys"
|
||||
|
||||
Reference in New Issue
Block a user