`resin ssh` fails with "Permission denied (publickey)."

How does resin-cli’s ssh command work?

My client is already authenticated via resin login, but I get the error above when I attempt to use resin ssh. resin.io web terminal works fine.

Looking at the verbose output, it looks like resin ssh depends on having my resin git key used as the ssh key. Since that key is not my default ssh key, how would I specify it? Normally I would use ssh -i ~/.ssh/identity but that does not appear to work with resin-cli.

1 Like

Hey @smartperson,

resin-cli depends on having your ssh key already loaded in your ssh agent, which can be done with ssh-add ~/.ssh/identity. This should solve your authentication issue with resin ssh, but please let us know if you still have difficulties setting it up.

Best, Kostas

I’m provisionally marking Kostas’ reply as solving your inquiry, if this is in error please feel free to correct us.

Or it can be also made accessible by adding .ssh/config with the contents of (and change identity into the ssh ley you are using, e.g. often id_rsa:

Host *
  IdentityFile ~/.ssh/identity

or with more narrowed down configuration:

Host *.resindevice.io
 IdentityFile ~/.ssh/identity

Just mentioning, because not everyone uses ssh-agent, and static config should help too.

Thanks, @imrehg and @kostas. Modifying ~/.ssh/config feels like the superior solution to me, as I prefer to control which identities are offered to which hosts.

:speech_balloon:You are welcome @smartperson, let us know if you need more help with this.

Best, Kostas