Score:0

Why does Gnome terminal only give access to SSH keys in the first tab of a window?

in flag

My SSH setup works pretty easy in XFCE4-terminal: the first time trying to log in to a server (from any terminal), Gnome-keyring asks for the passphrase for the corresponding ssh key in a popup window, and then accessing that server from any terminal would just work. It never needed any specific configuration for the graphical part, only the standard .ssh/ stuff.

For some reason, on Ubuntu 22.04 with Gnome-terminal, this works only as long as I keep to one tab per terminal window. I.e., if I open a new terminal window and try to SSH from there, it works as it should. But when I open a new tab in that same window and try SSH from that tab, it asks me for the passphrase on the command-line, which is quite inconvenient since I tend to have a lot of tabs open and explicitly running ssh-agent+ssh-add in each of them is just tedious.

How can I find out why the "first tab" and "further tabs" cases are handled differently, and how can this behaviour be changed?

cn flag
Looks like this bug: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/253
in flag
@egmont indeed! In my case, `SSH_AUTH_SOCK` is missing in secondary tabs, I assume that's what causes the problem.
raj avatar
cn flag
raj
I don't know if it helps for this bug, but have you tried adding `ssh-add` to "Startup Applications" of your GNOME session? It will ask you for SSH key passphrase once when you log in to GNOME, and then should use that passphrase for every subsequent ssh request automatically. At least that's how it's working for me in Ubuntu 20.04.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.