I have an SSH private key and I would like to be asked for the password every time if it is used. I don't know how to do this...

Thank you!

  • if you use it to connect through SSH and it has a passphrase, the passphrase should be asked every time, unless you use ssh-agent (or something like it).
    – pataluc
    Oct 24, 2014 at 12:11
  • I just have to unlock it once - I use it for GIT, sftp, SSH,...
    – Hans Wurst
    Oct 24, 2014 at 12:21
  • I think you have to specify if a passphrase when you generate the key. I don't think you can add one later.
    – Nifle
    Oct 24, 2014 at 12:26
  • It has a passphrase - I am asked once and after then the key is unlocked until I reboot my machine
    – Hans Wurst
    Oct 24, 2014 at 12:30
  • 1
    are you sure ssh-agent is not running? also, try to list files in your ~/.ssh dir after it's been cached.
    – pataluc
    Oct 24, 2014 at 12:42

1 Answer 1


You have to use ssh-agent. Make sure ssh-agent is started on your machine and add your private key to the ssh-agent with:

$ ssh-add ~/.ssh/id_rsa

Your Answer

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

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