ruby on rails - net_ssh on production returns 'Authentication Failed' using public keys -


i trying execute couple of commands on remote server , authentication method, using public keys.

public keys configured on server , can connect without system prompting me password this:

ssh root@example.com 

so in code:

net::ssh.start(host, user, :keys=>["~/.ssh/id_rsa","~/.ssh/id_rsa.pub"]) |ssh|   ssh.exec "service nginx reload" end 

on local machine, works properly, when on production server, error.

net::ssh::authenticationfailed: authentication failed user root@example.com 

i did googling , had tried fallback net_ssh 2.7.0, yet no luck, same issue. tried replace relative path absolute, in case /root/.ssh/... tried adding option

:auth_methods => ['publickey'] 

yet still, no luck.

i keys reside in correct paths.

edit 1

worth noting works when run in production rails console.

edit 2

symptoms here similar ones in question: net::ssh works production rails console, authenticationfailed production webapp exception app runs root , there shouldn't permission issues because of that.

edit 3

i had temporary fallen password auth works fine i'd use key auth instead.

any on issue appreciated.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -