Are you running xterm from inside your Gnome session as well?
Try this in Gnome Terminal:
Then try the same in xterm.
It should print something like
I'm guessing it doesn't print something like that in xterm.
If it's empty, something is clearing it (or not setting it).
If looks more like
then you are also running ssh-agent somewhere, which will get confusing.
Here's what I'd try:
echo $0 in both. Does one have
- at the start and the other not?
If so, you are probably running ssh-agent in login shells, but not non-login shells. Have a look in your
~/.bash_profile or equivalent scripts and fix the problem.
Or change whether xterm is started as a login shell:
xterm*loginShell: true or
xterm*loginShell: false in your
- by running
xterm -ls or
Copy the setting you have for Gnome Terminal under Profile Preferences->Title and Command->Run command as a login shell.
If that fails, try adding
echo statements in your startup files. You'll need to redirect the output to a log file using
echo $SSH_AUTH_SOCK >> ~/ssh-debug.log or similar.
Then log out and back in, and have a look at your
Then run Gnome Terminal and look at it again.
Then run xterm and look and look at it again.
Look for differences.
Have a look at /etc/pam.d/gdm and System->Preferences->Startup Applications. Do you have any other ssh-agent configuration anywhere in /etc/pam.d?
Have a look
/etc/X11/Xsession and the scripts that it calls.