Why does mate-terminal not inherit from ssh-agent? (was: ssh-agent seems to be "split" in different terminal programs (Ubuntu-MATE 24.04 LTS))

Adam Funk a24061 at ducksburg.com
Tue Dec 10 23:18:26 UTC 2024


On 2024-12-04, Adam Funk wrote:

> I did a fresh installation of Ubuntu-MATE 24.04 LTS on a laptop last
> week and copied most of my home directory over from another one
> (including some but not all of the dot-files and dot-directories).
>
> I'm using the mate-terminal and terminator for different things but
> the ssh-agent is not being shared between them; i.e., if I use ssh-add
> in either one, the keys are not unlocked in the other one, so I have
> to ssh-add in an instance of each terminal for everything to work. (If
> I close all the open terminals of either kind, the keys are still
> available when I launch a new one.)
>
> I think it is probably caused by this discrepancy:
>
> * in mate-terminal:
>
> $ env |grep -i ssh
> SSH_AUTH_SOCK=/tmp/ssh-H1CUqkimJczJ/agent.1284792
> SSH_AGENT_PID=1284793
>
> * in terminator:
>
> $ env |grep -i ssh
> SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
> SSH_AGENT_PID=1284793
>
>
> But I don't know what has caused that, or how to fix it so they both
> use the same SOCK. Any suggestions?
>
>
> I noticed these two lines in my ~/.profile
>
> # TEST 2021-08-25
> eval "$(ssh-agent)"

It turns out that those two lines were affecting mate-terminal but NOT
terminator. I commented them out, logged out and back in, and found
that mate-terminal then had no value for SSH_AUTH_SOCK; terminator had
the same one as before; and idle3 had the correct value too:

from os import environ
environ['SSH_AUTH_SOCK']
'/run/user/1000/keyring/ssh'

So why does mate-terminal NOT inherit it, while other things do?

I've hacked it by adding these lines to ~/.bashrc but I don't see why
I should have to:

# manually fudge cross-terminal ssh-agent
export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh


Any ideas?
Thanks.




More information about the ubuntu-users mailing list