I have two machines on which one is running a postgresql charm and other is running the charm I'm working on. Now I need to ssh into the postgresql machine to run some database migration scripts. For unknown reasons, the charm fails when it tries to ssh to the postgresql machine.

ssh ubuntu@
Permission denied (publickey). is the IP for postgresql machine. I've scoured the internet for public key issue and done everything from generating a public key myself to copying it to the other machine but even ssh-copy-id throws error of public key. If i try to ssh from a juju machine into any other non-juju machine it works smoothly.

Anyone ever faced this problem?


You should use juju ssh command instead, like juju ssh postgres/0. Check out the user guide

  • Well my question was regarding ssh to another juju machine from inside a juju machine. So juju ssh won't work inside the juju created machine. – Sid Mar 18 '16 at 14:04

Juju doesn't setup ssh authentication between units of a service. The only ssh authentication it sets up is between the node where you ran bootstrap and the service units that you deployed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.