Dokku asking for password when trying to git push
Asked Answered
K

6

8

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.

Korenblat answered 24/4, 2014 at 18:40 Comment(1)
Were you able to solve this? I'm stuck with the same issue.Launalaunce
A
9

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.

Analyst answered 15/9, 2014 at 19:22 Comment(0)
H
2

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.

Hargrove answered 5/5, 2014 at 17:34 Comment(0)
P
2

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.

Plumule answered 4/10, 2014 at 18:6 Comment(0)
R
2

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

Runion answered 28/2, 2021 at 12:17 Comment(0)
C
0

I had the same problem. I used this digital ocean tutorial

I'm a windows 8 user. I found I had two error:

  1. So I used puTTy as per the tutorial to generate my public and private SSH keys. Despite that, I found that my public key (id_rsa.pub) was wrong when I opened up Ruby on Rails with Command Prompt. You can change it by using git bash (allows windows users to use the linux terminal) editing the file via a text editor (I prefer to use vi ... commands are here)

  2. Following the SSH tutorial for windows, it doesn't tell you to modify the sshd_config file (link to that tutorial here). It's at "Step Six—Lockdown Root SSH Access to Keys Only". Once again, use gitbash to edit the sshd_config file via the text editor of your choice to make sure it has this configuration: PermitRootLogin without-password

That solved it for me. Hope it helps you guys.

Corliss answered 11/8, 2014 at 13:10 Comment(0)
R
0

This have happened to me. The cause was that my .ssh/id_rsa.pub key did not match the one I used when setting up Dokku.

The way I fixed this was to create a new key file in the Dokku server, paste inn my own SSH key, and then run: sudo dokku ssh-keys:add my_key_name /home/$USER/.ssh/my_key.pub

This will add your key to the Dokku authentication key file from the file in the given path.

Rampart answered 9/5, 2019 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.