J
J
jonic2016-02-03 03:51:24
SSH
jonic, 2016-02-03 03:51:24

ssh-agent keeps dropping out in ubuntu?

Good day. I ran into such a problem, the customer has ubuntu on the server, I'm used to using git as a version control system and for deploying a project. Faced a problem.
ps -e | grep ssh-agent
shows that the agent is running. But! one has only to call
ssh-add -l
and there will be an error:
Could not open a connection to your authentication agent.
if you kill the process by pid and start again (eval, just in the console, with or without indication, from root and a regular user), then everything will work after adding the key again for about half an hour (without closing the terminal session). Then again, git will tell me that it cannot access the repository, and ssh-add will swear that it cannot connect. This has never happened before, I'm more used to centos. In which direction to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Shumkin, 2016-02-11
@ashumkin

the other day I just researched the question ssh-agent`a (hereinafter "agent"):
, usually this variable can be set at startup, eval $(ssh-agent -s)
well, or "handles", knowing the name of the socket (you can find, for example, the socket of an already running agent:
in the general case, when X is started, its own instance of the agent is usually launched, installed, and all child processes already "have this" socket, SSH_AUTH_SOCK
since this is a server, it is unlikely that there are X, and when you enter through sshor ttyyou need to start your agent process or "restore the socket " from the one already running (in screenor tmux, for example)
but also what shows youps, it’s not yet a fact that this is YOUR agent, you will be convinced of this, at least by looking under which user it is running, otherwise, it seems to ps -eF
me, maybe the second user behaves like you: it
starts the agent, you bang it, it stops working , he bangs yours, and so on in a circle)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question