All threads / Rails, Hatchbox, New SSH Key and Permission denied (publickey)
Ask A Question


You’re not receiving notifications from this thread.

Rails, Hatchbox, New SSH Key and Permission denied (publickey)

Tom Dringer asked in Servers

Hi, I am having to use a different computer whilst mine is in for repair. So i generated the SSH keys to be used for deployment with Hatchbox. Using deploy@x.x.x.x or root@x.x.x.x just gives me an error Permission denied (publickey). Does anyone know a fix for this? I am locked out of my server and i desperately need to check the logs for an error which is giving me a white screen of death. Thanks

I am having the same issue - and I just created the cluster!

Same issue!

I'm trying to add a second key! I can see the key is added to the .ssh/authorized_keys files along with the default Hatchbox key and my other key.

But I'm trying to login from a second device, and am getting the "Permission denied (publickey)." issue!

For anyone surfacing this question in a Google Search:

I solved it by checking my ~/.ssh/authorized_keys files!

Make sure your keys are added to that file!

You'll need to do it manually as you cant login with a password and execute ssh-copy-id!

I just had this issue. I just presumed I needed to add my laptops ssh key to keys field in the profile serttings area but I then realised I needed to add it into the specific server SSH key field. Just double check it is in both as the second I added it to the server section it all worked fine for me.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 69,840+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.