Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to pull from a GitHub repository in an unattended way, but everytime I do it I get:

Enter passphrase for key '/home/yc2/.ssh/id_rsa': 

And I have to enter it for it work. I managed to skip it by using

eval `ssh-agent`
ssh-add <I enter my passphrase>

But that's only maintained on the actual session, but I need to do it with a PHP script, but if it asks the password, the script doesn't works, so how can I make it to not ask the password?

share|improve this question
up vote 2 down vote accepted

You can use ssh-keygen -p to change the pass phrase on the key, including setting no pass phrase

ssh-keygen -p
Enter file in which the key is (/home/iain/.ssh/id_rsa): /home/iain/.ssh/tmp/id_rsa
Enter old passphrase: <existing pass phrase>
Key has comment '/home/iain/.ssh/tmp/id_rsa'
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

If you use this key for other things you may be safer generating a keypair just for your program to use.

share|improve this answer

If you want to use it from a script perhaps you can remove the passphrase.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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