funtoo / keychain

keychain ssh-agent front-end
http://www.funtoo.org
GNU General Public License v2.0
757 stars 107 forks source link

Listing loaded SSH keys does not work #141

Open jwimberl opened 2 years ago

jwimberl commented 2 years ago

On CentOS 7 with keychain 2.8.5, keychain -l says that it could not connect to the SSH agent even when keychain --agents ssh confirms that there is an active ssh agent:

[username@host ~]$ keychain --agents ssh --eval id_ed25519

 * keychain 2.8.5 ~ http://www.funtoo.org
 * Starting ssh-agent...
SSH_AUTH_SOCK=/tmp/ssh-h4RyDrYLeJeX/agent.12192; export SSH_AUTH_SOCK;
SSH_AGENT_PID=12193; export SSH_AGENT_PID;

 * Adding 1 ssh key(s): /home/username/.ssh/id_ed25519
Enter passphrase for /home/username/.ssh/id_ed25519: 
 * ssh-add: Identities added: /home/username/.ssh/id_ed25519

[username@host ~]$ keychain -l
Could not open a connection to your authentication agent.
[username@host ~]$ 
mrl5 commented 2 years ago

hello @jwimberl - if you'd like to report a bug kindly use https://bugs.funtoo.org/

you can also reach us on Discord - for more info check https://www.funtoo.org/Welcome

AkashKrx commented 1 year ago

I found a simple solution to this problem is to call this file after keychain

source ~/.keychain/$HOSTNAME-sh

This file contains the env and the code to set them. My guess is keychain is not calling this file maybe?

You may want to look the contents of ~/.keychain/. Also contains the env for gpg and other agents.