WebFaction
Community site: login faq

Hello,

I use Github to store my projects and push to Github from my local machine. When I need to update my live server with the new code, I do a git pull to grab the new files.

However, every single time, I need to enter my Github passphrase to update the files, and this pisses me off :-) I've tried to follow the guide from Github about using ssh-agent to store my passphrase by changing my .bashrc file with the one they provided.

What I get as a message is Could not open a connection to your authentication agent..

Do you have any idea on how I could do to not have to enter my passphrase every single time?

Thanks a lot in advance.

asked 16 Jun '11, 14:39

djaiss
1112
accept rate: 0%


Add the following commands to the end of your .bash_profile or .bashrc

pgrep ssh-agent || ssh-agent -a $HOME/.ssh/ssh-agent.sock
export SSH_AUTH_SOCK=$HOME/.ssh/ssh-agent.sock
ssh-add

That's it - after doing that, you'll be prompted for your passphrase once when you log in, and shouldn't be prompted again throughout your SSH session.

permanent link

answered 16 Jun '11, 16:28

seanf
12.2k42136
accept rate: 37%

Thank you very much for your answer. I've done it, but I still get the message

Could not open a connection to your authentication agent

Just to let you know, I haven't install anything on my webfaction other than simple php applications.

(16 Jun '11, 20:49) djaiss

Did you try logging out and back in? .bash_profile will only reload on a new SSH session.

(16 Jun '11, 21:48) johns

Yes of course, after having done a source .bashrcI logged out just in case, and logged back in. Still get this message :-/

(17 Jun '11, 07:13) djaiss

Is ssh-agent running right now?

Also, try adding this to your .bashrc:

eval `ssh-agent`
(17 Jun '11, 07:42) David L ♦♦

You were right, ssh-agent was not running. Thanks a lot for you help everyone and sorry for the trouble!

(17 Jun '11, 08:15) djaiss

When I do what is suggested here I get the same

Could not open a connection to your authentication agent

message. How would I check if ssh-agent is running? I tried the eval ssh-agent which works but it appears to spawn a new ssh-agent every single time I login. Any hints?

I also noticed that if I manually pgrep ssh-agent there is one pid that I can't kill.

(26 Feb '13, 15:56) joshcartme

It's possible that you're grepping for a process that's not yours. I would recommend using:

ps -u $USER -F | grep 'ssh-agent'

If you can't seem to terminate the process, and it's definitely yours, there's always kill -9.

And, for reference, the ssh-agent startup code I use is:

mkdir -p $HOME/tmp
rm -f $HOME/tmp/agent
eval $(ssh-agent -a "$HOME/tmp/agent" -s)
ssh-add

I first ensure that there aren't any existing ssh-agent processes running.

Finally, note that you can run this first and then initiate a screen session, and the screen session will remember the passphrase even after detaching and re-attaching. Hope that helps!

(27 Feb '13, 03:15) ryans ♦♦

Thanks for the help Ryan and sorry to be dense, but would you recommend adding that second bit of code directly to my bash_profile? I tried that and the first time I log in it works but subsequent logins give me the Could not open ... error. If I kill the ssh-agent process and login again it works.

(27 Feb '13, 12:05) joshcartme

Submit a support ticket so we can see what is happening in your case.

(27 Feb '13, 21:42) johns
showing 5 of 9 show 4 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×7
×1

question asked: 16 Jun '11, 14:39

question was seen: 3,329 times

last updated: 28 Mar '13, 03:09

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM