Home > Software engineering >  "git push dokku" keeps asking for "dokku@..." password
"git push dokku" keeps asking for "dokku@..." password

Time:11-30

On my remote server all I did is:

wget https://raw.githubusercontent.com/dokku/dokku/v0.26.6/bootstrap.sh;
sudo DOKKU_TAG=v0.26.6 bash bootstrap.sh

dokku apps:create node-sample

Then on my local machine:

git clone https://github.com/pedropaf/node-sample-dokku
cd .\node-sample-dokku\

git remote add dokku [email protected]:node-sample

ssh-keygen -f vincent

cat vincent.pub | ssh [email protected] dokku ssh-keys:add git-deploy

(I can see the ssh key when I run ssh-keys:list in my remote server)

still locally:

ssh-add vincent

Then when I run:

git push dokku main

I receive:

[email protected]'s password:

I don't understand why it doesn't establish the ssh connection and request the user password instead (user that doesn't exist)

CodePudding user response:

So you are following the article "Hosting NodeJs Apps on Your Own Heroku, Using Dokku" from Pedro Alonso

The problem is: you are using a non-default naming convention for your SSH key (vincent.pub for you, dokku_rsa.pub in the article)

For a git push to work, you would need:

  • an %USERPROFILE%/.ssh/config file set to reference your private key
  • a remote URL using the .ssh/config Host entry

That is

# .ssh/config
Host dokku
  Hostname 116.123.123.123
  User dokku
  IdentityFile ~/.ssh/vincent

And:

cd /C/path/to/local/clone
git remote set-url dokku dokku:node-sample

Then a git push would use your private key.


From the discussion and the comments, Vincent has found "SSH-Key authentication fails" and did:

sudo chown dokku:dokku /home/dokku/ -R
sudo chmod o-rwx /home/dokku/ -R

That was enough to make the dokku SSH URL work.

  • Related