fish-ssh-agent icon indicating copy to clipboard operation
fish-ssh-agent copied to clipboard

SSH_AGENT_PID not set

Open nagromc opened this issue 9 years ago • 5 comments

SSH_AGENT_PID is not set when I try to add an SSH key with ssh-add ~/.ssh/id_rsa.

$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.
$ echo $SSH_AGENT_PID

$ # ↑ empty string ↑

Yet, ssh-agent is well started:

$ ps aux | grep ssh-agent
morgan   16643  0.0  0.2   3688   984 ?        Ss   11:43   0:00 ssh-agent -c

I did manage to add a key with the following commands:

$ eval (ssh-agent -c)
Agent pid 18541
$ echo $SSH_AGENT_PID
18541
$ ssh-add ~/.ssh/id_rsa
Identity added: /home/morgan/.ssh/id_rsa (rsa w/o comment)

My configuration:

$ fish --version
fish, version 2.2.0
$ ssh -V
OpenSSH_6.7p1 Raspbian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016

Not sure how ssh-agent works though... Any help would be much appreciated.

nagromc avatar Sep 13 '16 10:09 nagromc

Forgot to mention that I configured fish so that each time I login, fish tries to attach an existing tmux session, or creates one if doesn't exist yet. Maybe it is related to tmux.

nagromc avatar Sep 13 '16 12:09 nagromc

I'm having the same issue using: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016 fish, version 2.2.0

For me I attach a screen session when I login, or similarly create one if it didn't exist.

fbcotter avatar Nov 03 '16 23:11 fbcotter

Some time ago I rewrote fish_ssh_agent to fix some issues https://github.com/ivakyb/fish_ssh_agent, and use it more than a year on 5 machines successfully with no issues.

ivakyb avatar Mar 04 '19 12:03 ivakyb

Some time ago I rewrote fish_ssh_agent to fix some issues https://github.com/ivakyb/fish_ssh_agent, and use it more than a year on 5 machines successfully with no issues.

Did you open any issues to try to get those issues fixed here? I don't see any. I encourage you to open a PR to get the changes back here.

ElijahLynn avatar Nov 25 '20 23:11 ElijahLynn

I solved this issue by running fundle init in my config.fish.

clemensmanert avatar Dec 06 '20 15:12 clemensmanert