gitsshmediatemplessh-agent

github ssh-agent timeout mediatemple


I'm trying to do some development work from a mediatemple server through git; I've got my ssh key setup properly however it seems like I'm having issues with the ssh-agent. You can see from the prompts below that, after setting up the agent, I'm able to properly connect to the git server. However, after about 15min, the agent times-out; at which time I have to run it again and add my key.
Does anyone know how to get around needing to this every time? I've already tried opening a ticket up with MT and chatted with their support, but they aren't much help...

15:04:03 login: ~ $ssh -T git@github.com
Permission denied (publickey).
15:04:26 login: ~ $ssh-add -l
Could not open a connection to your authentication agent.
15:04:33 login: ~ $eval "$(ssh-agent -s)"
Agent pid 19228
15:04:39 login: ~ $ssh-add ~/.ssh/id_rsa_github
Identity added: /home/215537/users/.home/.ssh/id_rsa_github (/home/215537/users/.home/.ssh/id_rsa_github)
15:04:47 login: ~ $ssh-add -l
4096 e4:26:3e:f0:33:d3:74:4c:2c:fe:9c:d8:e8:59:9a:53 /home/215537/users/.home/.ssh/id_rsa_github (RSA)
15:04:50 login: ~ $ssh -T git@github.com
Hi ConstantinoSchillebeeckx! You've successfully authenticated, but GitHub does not provide shell access.
15:17:28 login: ~ $ssh -T git@github.com
Permission denied (publickey).
15:17:36 meepmoop.com@n10: ~ $ssh-add -l
Could not open a connection to your authentication agent.
15:20:21 meepmoop.com@n10: ~ $eval "$(ssh-agent -s)"
Agent pid 26564
15:20:27 meepmoop.com@n10: ~ $ssh-add ~/.ssh/id_rsa_github
Identity added: /home/215537/users/.home/.ssh/id_rsa_github (/home/215537/users/.home/.ssh/id_rsa_github)
15:20:33 meepmoop.com@n10: ~ $ssh -T git@github.com
Hi ConstantinoSchillebeeckx! You've successfully authenticated, but GitHub does not provide shell access.

Solution

  • Use ssh_config in ~/.ssh/config:

    Host github.com
      IdentityFile ~/.ssh/id_rsa_github
    

    and then you don't need any agent.