2

I want to access GitHub via SSH. I have created a passphrase protected SSH key which I want to add to the ssh-agent on login.

If I add a SSH key to ssh-agent via command ssh-add ~/path/to/key </dev/null and have ssh-askpass client like ksshaskpass installed on the system then it would ask for the password. On KDE, this password is also persisted across login.

How can I automatically add ssh keys to the ssh agent on startup in Raspberry Pi? On regular Linux, I have ksshaskpass add the keys to the ssh-agent via a command like ssh-add ~/path/to/key </dev/null. The ssh-askpass available in Pi can ask for the ssh passphrase but it can't remember it.

How can I save ssh key phassphrase and it be provided automatically to ssh-agent like ksshaskpass?

13
  • 1
    does superuser.com/questions/1360324/gpg-remove-passphrase answer your question? Remembering a passphrase defeats the purpose of a key protected by one. As such if you want to just use the key file, remove the passphrase.
    – Abel
    Feb 2, 2022 at 12:40
  • It may help you get a good answer if you could explain what it is you're trying to accomplish.
    – Seamus
    Feb 2, 2022 at 22:05
  • @Seamus I want to add my ssh key to the ssh-agent so that I can commit to GitHub via SSH docs.github.com/en/authentication/connecting-to-github-with-ssh/… Feb 3, 2022 at 3:32
  • 1
    @Seamus I think I have found a perfect solution for this problem. It turns out my password manager can also add SSH agent. If and when I am asked for a ssh key then the password manager can be used for it. There seems to be another option which I might have to explore keychain. Thanks for taking time to help me out with this. Feb 6, 2022 at 4:06
  • 1
    Congratulations! You should answer your own question. It may help others, and you can select it as the correct answer.
    – Seamus
    Feb 6, 2022 at 8:36

1 Answer 1

0

From the comments, the OP says:

It turns out my password manager can also add SSH agent. If and when I am asked for a ssh key then the password manager can be used for it. There seems to be another option which I might have to explore keychain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.