- Place it in the right place
cp /path/to/my/key/id_rsa ~/.ssh/id_rsa
cp /path/to/my/key/id_rsa.pub ~/.ssh/id_rsa.pub
- change permissions on file
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 644 ~/.ssh/id_rsa.pub
- start the ssh-agent in the background
eval $(ssh-agent -s)
NOTE: If your shell is
fish
, then just execute thessh-agent -s
and then export those printed variables.
- Make ssh-agent to actually use the copied key
ssh-add ~/.ssh/id_rsa
No need to import public key.