I recently generated ssh keys, copying my public key to the server I need access to and keeping my private key in my ~/.ssh/ directory.

Everything works great but ssh prompts me for the passphrase every single time I want to login to the server. I was under the impression that if I am logged in as root and have the private key stored locally in my directory, the passphrase is only needed at first login.

Ideally I would like to access the server seamlessely using no passphrase and just the key, this way I can passwordless rsync and such.

Is this possible? I do remember an option to include a passphrase and typed one in assuming this was most secure. Maybe I shouldn't have.

  • did you injected the public-key into .ssh/authorized_keys or did you just 'copied it into .ssh'? – akira Jan 10 '13 at 8:47
  • I injected it into the authorized keys file. – Scandalist Jan 10 '13 at 8:48

If your private key has a password on it and you only want to have to enter the password once per session, use ssh-agent and ssh-add.


In my case, setting a new passphrase but leaving it blank was the solution. It appears you can cache the passphrase in a file for an extended period of time but I require seamless backups with zero worry.

ssh-keygen -p

  • "Setting a new passphrase but leaving it blank" is better known as "removing the passphrase." Your could have also removed the passphrase from your existing key by this method. – Jim L. Aug 4 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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