Dooku asks for password even if SSH keys are correctly added

Hi,

In order to deploy to my Dokku server hosted in Digital Ocean I have done the next:

1 . I have created a new SSH Key and I have added the public to my Digital Ocean
And the private to my CircleCi project
2 . I have added a call to a deploy.sh file at my circle.yml file

deployment:
production:
branch: master
commands:
- ./deploy.sh

3 . I have added the follwing commands to my deploy.sh file

####! /bin/bash

git remote add production dokku@daniboomerang.com:daniboomerang
git push production master

4 . And at the end of my build I can see this

$ ./deploy.sh05:24config
./deploy.sh
Warning: Permanently added ‘daniboomerang.com,178.62.46.230’ (ECDSA) to the list of known hosts.

dokku@daniboomerang.com’s password:

5 . So I have build again and access through ssh to it
I wanted to check if my private key was added and if the public was the one I had in Digital Ocean.

And they were:

ubuntu@box196:~/daniboomerang$ cd ~/.ssh
ubuntu@box196:~/.ssh$ ls
authorized_keys build_key.rsa config id_circleci_github id_daniboomerang.com id_daniboomerang.com.pub id_heroku.com id_heroku.com.pub known_hosts

6 . I have checked my public key

ubuntu@box196:~/.ssh$ vi id_daniboomerang.com.pub
And it is the key I have on Digital Ocean.
And of course the private key is the one on CircleCi

Any idea about what am I missing?

Thanks

Regards

Is dokku a user on your server? Is the public key for the key you are using to deploy in dokku's ~.ssh/authorized_keys file?

Hi,

Thanks for your answer.

No, actually the Key wasn´t on ~.ssh/authorized_keys
Actually this file was empty.
And I have added and launch the build but still not working…

Still gets stacked on

$ ./deploy.sh05:24config
./deploy.sh
Warning: Permanently added 'daniboomerang.com,178.62.46.230' (ECDSA) to the list of known hosts.

dokku@daniboomerang.com's password:

What do you mean with if it Dokku a user on my server?

But then I thought…If the file was empty…why I am able to make a

git push production master

from my laptop?
If I am not wrong I have followed the same steps…adding private to my laptop adding a public in Digital Ocean…

Ok you were right, I was looking at root@daniboomerang instead of dokku@daniboomerang.
I have added the key and I think it is working!
I mean…I get this

./deploy.sh
Warning: Permanently added ‘daniboomerang.com,178.62.46.230’ (ECDSA) to the list of known hosts.

To dokku@daniboomerang.com:daniboomerang
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'dokku@daniboomerang.com:daniboomerang'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

./deploy.sh returned exit code 1

hint: See the 'Note about fast-forwards' in 'git push --help' for details. Action failed: ./deploy.sh

but this is a different thing and I guess this means that I already have access to push from circle isn´t it?

1 Like