[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Issues with SSH pubkey authentication at remote server



On 09/27/2016 02:02 PM, Stephan Beck wrote:
> Hi Lars,
> 
> Lars Noodén:
>> On 09/26/2016 05:46 PM, Stephan Beck wrote:
>>> ... it might
>>> not be necessary to fire it up with eval $(ssh-agent).
>>> Thanks for the command, makes it more easy.
>>
>> No problem.  If you want to see which keys are available to ssh, you can
>> use ssh-add for that:
>>
>> 	ssh-add -L
>>
>> It has to be run in the same shell as you would then run ssh.
>>
>> That will list the public key matching the private key which has
>> actually been loaded into the available agent.  But that availability
>> might be the issue here, as with the earlier message, I am still
>> wondering if ssh is finding the "right" agent.
> 
> I've tried again and detected the following:
> No agent is started when I login to the "local ssh user account".

It is the one that should be running under your local account that is of
relevance, or at least should be.  How are you logging in to your "local
ssh user account" there?

Your processes including the terminal need to be inheriting the
environment variables SSH_AGENT_PID and SSH_AUTH_SOCK.  If they are not
in the environment, then your processes need to be pointed to socket and
process id explicitly.

> I have to do
> eval $(ssh-agent) --> for every single session
> ssh-add /path/to/key
> ssh-add -L
> (outputs the key)
> Then I connect to the remote server and it works without having to type
> a passphrase. Gee!

Ok.  So the keys work and it is possible to add on an agent after
logging in.  Can you tell more about how your login session is started?

Regards,
Lars



Reply to: