Skip to content

ssh

prerequisites

make sure you've...

  • installed git

    apt install -y git
    
    pacman -S --noconfirm git
    

make sure you've...

  • installed git

    winget install -eh --id Git.Git
    

creating an ssh key

ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 -C "$EMAIL" -N "$PASSPHRASE"
clip < ~/.ssh/id_ed25519.pub # (1)!
  1. ssh pub key is in the clipboard

make sure you've...

backing up an ssh key

note that...

  • an ssh key backup will be made available in ~/Downloads
1
2
3
cd ~/.ssh
tar -czvf "$(date '+%F').ssh_key.tar.gz" id_ed25519 id_ed25519.pub
mv "$(date '+%F').ssh_key.tar.gz" ~/Downloads

make sure you've...

  • backed up the ssh key backup somewhere safe (e.g. bitwarden)

importing an ssh key

make sure you've...

  • copied an old ssh key backup to ~/Downloads
1
2
3
4
5
6
cd ~/Downloads
tar -xzvf $DATE.ssh_key.tar.gz # (1)!
mv id_ed25519 id_ed25519.pub ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519.pub
rm *ssh*.tar.gz
  1. $DATE is the date of the ssh key backup to-be imported (e.g. 2025-01-01)

deleting an ssh key

rm ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub

make sure you've...

  • removed the old ssh key from github

resources