I have tried the following:
ssh-add -K ~/.ssh/id_rsa
This seems to work until I end my terminal session, but then I get prompted for my passphrase again with a new session.
Here is what I see after running the command above:
Identity added: /Users/xxx/.ssh/id_rsa (/Users/xxx/.ssh/id_rsa)
I am on iTerm2 Build 3.0.13
with zsh: stable 5.3.1
running on macOS Sierra 10.12.2
One solution is to add the command in ~/.profile
or ~/.bashrc
file. Then every time you open a new terminal the command will be executed automatically.
Since you are using zsh
you need to add the command in ~/.zprofile
or ~/.zshrc
file.
ssh-add -K ~/.ssh/id_rsa &> /dev/null
The &> /dev/null
is to avoid seeing the Identity added
message everytime you open a new terminal window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With