Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
ssh-keygen¶
Run the command ssh-keygen to interactively generate a new pair of public/private keys.
It is strongly suggested that you protect your private keys with a passphrase.
With the increasing using of AI agent/skills,
the risk of leaking keys/tokens is much higher compared to before.
SSH agent¶
Follow the steps below to setup the ssh agent if you protect your SSH private keys with a passphrase.
Upload your SSH public key to servers (e.g., GitHub) that you need to access via SSH.
Run the following command to terminate previously created and persisted SSH tunnels (if any).
ssh -O exit git@github.comRun the following command (for fish).
eval (ssh-agent -c)It’s the best to add the following script into your config.fish.
if not set -q SSH_AUTH_SOCK
eval (ssh-agent -c) > /dev/null
endLoad the SSH private key you need into SSH agent.
ssh-add ~/.ssh/id_ed25519Tips for SSH Config¶
Persist SSH connections helps.