I have created a droplet on digital ocean with an image of ubuntu and dokku. I have followed this tutorial to deploy my app, I have also done the configuration to add my ssh key to dokku. Now when I try to "git push [name] master" I get asked for "dokku@domain" password.
I had this problem too because I work from multiple machines so even though I uploaded both public ssh keys to digital ocean prior to creating the droplet when I went to sign in I could do so on both machines if I was logging in as the user 'root',
however when I went to push for the first time using
$ git remote add dokku [email protected]
$ git push dokku
like it does in the digital ocean guide i was following.
I found out that the user 'dokku' only had one of the keys loaded in its authorized keys file.
so here is what I did. In my terminal I used $ cat ~/.ssh/id_rsa.pub
which will display your public ssh key and I highlighted that whole thing and copied that.
I logged in to my server as the root $ ssh [email protected]
then made my way to the dokku users authorized keys folder $ cd /home/dokku/.ssh/
I then open that $ nano authorized_keys
now in this file I already had one key but you might not have any. In either case I pasted my ssh-key in this file and exited the file.
From there I was pretty much good now if I push using the dokku user it doesn't ask for a password because it already recognizes my ssh-key. By the way there is a way to simplify all this to like two steps but sometimes I like to go about it the long way just to make sure the key actually made it into the file.
Try adding your local SSH key in DigitalOcean control panel, then delete the old droplet and create a new one using this key. Now when you open droplet IP in the browser you should see Dokku Setup page with your key, after finishing setup git push should work.
Make sure that you add DigitalOcean Dokku remote on your LOCAL computer. If you will try to add it on DO droplet (yes, I made that stupid mistake) you will be asked for password.
This is the command for all steps described by @mkrinblk above:
$>
cat ~/.ssh/id_rsa.pub | ssh [email protected] "sudo sshcommand acl-add dokku [description]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With