I start a new shell (new terminal window), then here are all the commands I run:
user@host :~ $ eval "$(ssh-agent -s)"
Agent pid 1413341
user@host :~ $ ssh-add -vvv ~/.ssh/keys/<mykey>
Enter passphrase for /home/mate/.ssh/keys/<mykey>:
user@host :~ $ ssh-add -l
The agent has no identities.
ssh-add
doesn't return any output, but after verification, returns an error code of 1
(tried ssh-add ...
again then echo $?
). However, it really doesn't print any output on stderr.
The env vars $SSH_AGENT_PID and $SSH_AUTH_SOCK are correctly set after the eval "$(ssh-agent -s)"
command.
PS: Also tried the full operation with eval "$(ssh-agent)"
instead, to no avail.
PS: Unless I missed something, all questions on stackoverflow, superuser, and unix.stackexchange are dealing with another specific case, such as running ssh-add
alone (and thus only taking standard key locations into account) or people who haven't started the agent correctly etc...