I have an application which creates an x-session, the problem I'm having is with ssh-agent.

Lets say I have created a unix socket, and then create x-session(in this session ssh-agent is launched). So my question is:

Is it possible to launch x-session and have my socket path set as SSH_AUTH_SOCK for ssh-agent?

I have tried setting my socket path in SSH_AUTH_SOCK in x-session creation command, manually checked and new init process contains my sockets path. But for some reason when I launch terminal(inside this session) and echo $SSH_AUTH_SOCK some other path is displayed. Seems like some other process is overwriting it.

Is there any way to predefine $SSH_AUTH_SOCK before launching x-session?


If you have control of the (xinit) script which is starting the ssh-agent, then you can override the default socket path using the -a PATH option, per the man page:

     -a bind_address
         Bind the agent to the UNIX-domain socket bind_address.  The default is
  • unfortunately I don't have control of xinit script. – user3503143 Feb 1 '18 at 6:25

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.