Add ssh setup script
This commit is contained in:
parent
ef3fde6d7f
commit
bf26066aaf
|
@ -26,6 +26,7 @@ packages:
|
||||||
- git
|
- git
|
||||||
- gnupg
|
- gnupg
|
||||||
- htop
|
- htop
|
||||||
|
- inetutils
|
||||||
- iotop
|
- iotop
|
||||||
- linux-firmware
|
- linux-firmware
|
||||||
- lm_sensors
|
- lm_sensors
|
||||||
|
|
16
scripts/setup_ssh_key.sh
Executable file
16
scripts/setup_ssh_key.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env -S bash -i
|
||||||
|
|
||||||
|
if [ -f "${HOME}/.ssh/id_ed25519" ]; then
|
||||||
|
echo "SSH private key already exists. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
HOSTNAME=`hostname`
|
||||||
|
|
||||||
|
ssh-keygen -t ed25519 -C "$USER@$HOSTNAME"
|
||||||
|
|
||||||
|
ssh-keyscan -H git.devroom.io >> "${HOME}/.ssh/known_hosts"
|
||||||
|
ssh-keyscan -H github.com >> "${HOME}/.ssh/known_hosts"
|
||||||
|
|
||||||
|
echo "--- Your public key, sir:"
|
||||||
|
cat "${HOME}/.ssh/id_ed25519.pub"
|
Loading…
Reference in New Issue
Block a user