Ubuntu: Nautilus “open in terminal” extension will not propagate SSH_AUTO_SOCK?



Question:

I have Ubuntu Gnome 14.04, up-to-date; nautilus and nautilus-open-terminal are installed and updated:

 [romano:~] % wajig status nautilus nautilus-open-terminal  Package                 Installed       Previous        Now             State  =======================-===============-===============-===============-=====  nautilus                1:3.10.1-0ubuntu9.7 1:3.10.1-0ubuntu9.7 1:3.10.1-0ubuntu9.7 install  nautilus-open-terminal  0.20-1          0.20-1          0.20-1          install  

I noticed that the ssh-derived commands in the terminals opened by the right-click "Open in terminal" from nautilus windows kept asking my passphrase; upon further investigations, it results that a normal shell, started with CTRL-ALT-T or with the dash, I have:

[romano:~] % env | grep -i ssh                             SSH_AUTH_SOCK=/run/user/1153/keyring-S6rI11/ssh  

while in the "open in terminal" shell I have no trace of that environment variable:

[romano:~/education … -SAP-135/Lab-8] % env | grep -i ssh  [romano:~/education … -SAP-135/Lab-8] 1 %  

...and generally, environment variables are passed to this shell:

[romano:~/education … -SAP-135/Lab-8] 1 % env | wc -l        70  

Why is the SSH_AUTH_SOCK shell variable not passed down? Is it possible to avoid it?


Solution:1

There is a launchpad bug report for this issue: #1411174


Solution:2

OK, it's a bug. Probably the nautilus issue is launched before the shell that sets up the SSH* variables.

Workaround

(ugly).

  1. open a terminal
  2. kill the file manager: nautilus -q
  3. restart it again: nautilus & disown %%, in background and detached.
  4. close the terminal

Now the new nautilus session in the desktop is descendent from a shell with the SSH_AUTH_SOCK correctly set up, and the spawned terminal will have it all right.

Until nautilus crashes or die for whatever reason. In that case, repeat.


Solution:3

Not sure if this is a good solution, I added the following line into the ~/.profile:

export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh  

My key is unlocked on login.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »