You are not logged in.

#1 2015-12-18 08:34:10

toogy
Member
Registered: 2013-10-25
Posts: 46

[SOLVED] keychain not working with fish

I'm using keychain so that I have to type my SSH key passphrase (I know I should use more than one) only once when I log in.

I was using zsh and had this in my .zshrc :

eval $(keychain --eval --agents ssh -Q --quiet id_rsa --nogui)

I recently switched to the fish shell and I have this in my .config/fish/config.fish

keychain --eval --agents ssh -Q --quiet id_rsa --nogui

The problem is that it's not working anymore.
It asks for my passphrase once, which is normal but then when I ssh it asks for it again.

Also, after the first time the keychain is executed, every time i open a new shell, this is printed:

set -e SSH_AUTH_SOCK; set -x -U SSH_AUTH_SOCK /tmp/ssh-62qYuphD7SWy/agent.882;
set -e SSH_AGENT_PID; set -x -U SSH_AGENT_PID 883;

If someone could help me!

Last edited by toogy (2015-12-27 04:33:45)


water vapor is invisible

Offline

#2 2015-12-21 06:26:13

danielgreve
Member
Registered: 2015-12-11
Posts: 11

Re: [SOLVED] keychain not working with fish

Try:

eval (keychain --eval --agents ssh -Q --quiet id_rsa --nogui)

http://fishshell.com/docs/current/tutor … stitutions

Offline

#3 2015-12-21 06:57:00

toogy
Member
Registered: 2013-10-25
Posts: 46

Re: [SOLVED] keychain not working with fish

Yay that fixed it.
Could you explain what 'eval' is doing here? I'm not sure I get it, even with the 'Command substitutions' part of fish's tutorial hmm


water vapor is invisible

Offline

#4 2015-12-22 04:48:59

danielgreve
Member
Registered: 2015-12-11
Posts: 11

Re: [SOLVED] keychain not working with fish

It's synonymous to the line from your .zshrc. That particular keychain command appears to print a string of shell commands that set environment variables. It does not evaluate that string, however. The combination of eval and command substitution allows you to capture the output of a command and evaluate it. Hope this helps.

http://fishshell.com/docs/current/commands.html#eval
https://en.wikipedia.org/wiki/Command_substitution

Offline

#5 2015-12-27 04:33:24

toogy
Member
Registered: 2013-10-25
Posts: 46

Re: [SOLVED] keychain not working with fish

Oh yes, much clearer ! Thanks @danielgreve smile


water vapor is invisible

Offline

#6 2015-12-27 08:02:44

danielgreve
Member
Registered: 2015-12-11
Posts: 11

Re: [SOLVED] keychain not working with fish

Sure thing! Happy to see other Archers out there using fish as their login shell. :~)

Offline

Board footer

Powered by FluxBB