View previous topic :: View next topic |
Author |
Message |
d_m Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/12935044173ee8a97e45c37.png)
Joined: 12 Jun 2003 Posts: 570 Location: Philadelphia, PA, USA
|
Posted: Tue Jul 26, 2005 3:18 pm Post subject: keychain + GNU screen problems [SOLVED] |
|
|
Hey, I've been using keychain from within Gnome for awhile and it's a really sweet program. I have SSH keys set up properly and I don't have to use a password to SSH to my remote hosts from Gnome Terminal or XTerm.
Recently, I started using GNU screen on this box and no matter what I do it seems like I can't get screen to use the same SSH-agent. It asks me for my SSH key's password, which I give, and then SSH works, but I can't get it to detect the agent is running. I have tried starting keychain from within screen, and that doesn't seem to make a difference.
Do I need to have multiple ssh-agents running (one in the context of Gnome, one in the context of screen) for this to work? Does anyone have any ideas?
Thanks. _________________ The name that can be named is not the eternal name.
Last edited by d_m on Tue Jul 26, 2005 5:42 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Nuteater Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/16978633333f73140e3e859.png)
Joined: 25 Sep 2003 Posts: 193 Location: Jyväskylä, Finland
|
Posted: Tue Jul 26, 2005 3:58 pm Post subject: |
|
|
It seems the environment variables associated with ssh-agent
need to be loaded inside the screen session to have effect.
Google came up with this:
http://unix.frogcircus.org/screen/ssh-agent
I hope it helps ![Smile :)](images/smiles/icon_smile.gif) _________________ I am Nuteater, hear me roar. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d_m Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/12935044173ee8a97e45c37.png)
Joined: 12 Jun 2003 Posts: 570 Location: Philadelphia, PA, USA
|
Posted: Tue Jul 26, 2005 4:12 pm Post subject: |
|
|
Thanks, that is really helpful! _________________ The name that can be named is not the eternal name. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d_m Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/12935044173ee8a97e45c37.png)
Joined: 12 Jun 2003 Posts: 570 Location: Philadelphia, PA, USA
|
Posted: Tue Jul 26, 2005 5:41 pm Post subject: |
|
|
OK, so the trick that I have found is to populate ${HOME}/.ssh/screen_agent (or whatever you want to call the file) with something like this (assuming you're running a bourne compatible shell):
Code: | export SSH_AUTH_SOCK=/tmp/ssh-fSKjSC7991/agent.7991
export SSH_AGENT_PID=8008 |
And then add to ${HOME}/.screen (somewhere before you want to launch your shells/ssh sessions):
Code: | source $HOME/.ssh/screen_agent |
To do the above, I wrote a script called mykeychain which calls keychain for me but also creates the appropriate file:
Code: | #!/bin/sh
keychain ${HOME}/.ssh/id_dsa
(
echo "export SSH_AUTH_SOCK=${SSH_AUTH_SOCK}"
echo "export SSH_AGENT_PID=${SSH_AGENT_PID}"
) > ${HOME}/.ssh/screen_agent |
So yeah, I hope this helps someone else. I'm marking this thread solved. _________________ The name that can be named is not the eternal name. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|