3

We have a build system that needs an active ssh connection with mercurial and to do so, it needs an ssh-agent loaded with a key constantly..

The thing is that, even though that after creating the ssh agent eval $(ssh-agent -s) and setting up the environment variables:

  • SSH_AUTH_SOCK
  • SSH_AGENT_PID

Doing env | grep SSH:

SSH_AGENT_PID=7601
SSH_CLIENT=***.***.***.*** 53371 22
SSH_AUTH_SOCK=/tmp/ssh-4gJ9y89gPzbg/agent.7600
SSH_CONNECTION=***.***.***.*** 53371 10.0.67.4 22

After I log out from them EC2 Instance, after a few hours of the program running and pulling repos, etc. It would suddenly get this error:

CommandError: (-1, 'remote: ssh_exchange_identification: Connection closed by remote host', 'abort: no suitable response from remote hg!')

Then when I go and check the env | grep SSH the only thing that is setup is the SSH_CONNECTION and the SSH_CLIENT.

  1. Why would this occur? Are these environment variables only setup in the session?

  2. And if so, why would it only fail after long hours of already logging out?

  3. How can I make so that these environment variable are always there so that it doesn't break my program by not having these 2 environment variables setup?

  • Are you running your session in screen or tmux on the remote host? – Kusalananda Jun 28 '19 at 16:46
  • I am not running either screen or tmux – christopher de jesus Jun 28 '19 at 16:47
-1

Time out in your password but I do not know your operating system or the settings.

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.