Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dokku asking for password when trying to git push

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.

like image 821
user3570188 Avatar asked Apr 24 '14 18:04

user3570188


4 Answers

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.

like image 50
mkrinblk Avatar answered Nov 10 '22 16:11

mkrinblk


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.

like image 22
Dan Avatar answered Nov 10 '22 17:11

Dan


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.

like image 2
karolf Avatar answered Nov 10 '22 15:11

karolf


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]"

like image 1
Akim Khalilov Avatar answered Nov 10 '22 15:11

Akim Khalilov