Dokku在尝试git push时要求输入密码 [英] Dokku asking for password when trying to git push

查看:124
本文介绍了Dokku在尝试git push时要求输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数字海洋上创建了一个带有ubuntu和dokku图像的小滴。我已经按照教程部署了我的应用程序,还完成了配置,以将我的ssh密钥添加到dokku中。现在,当我尝试 git push [name] master时,我被要求输入 dokku @ domain密码。

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也有这个问题,因为我在多台计算机上工作,因此即使我在登录时创建小滴之前将两个公共ssh密钥都上载到了数字海洋,但如果我以root用户身份登录,也可以在两台计算机上都这样做',

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',

但是我第一次使用

$ git remote add dokku dokku@my.server.url
$ git push dokku

>就像我遵循的数字海洋指南中一样。

like it does in the digital ocean guide i was following.

我发现用户'dokku'仅在其授权密钥文件中加载了一个密钥。

I found out that the user 'dokku' only had one of the keys loaded in its authorized keys file.

这就是我所做的。在我的终端机中,我使用了 $ cat〜/ .ssh / id_rsa.pub ,它将显示您的公共ssh密钥,并突出显示了整个内容并将其复制。

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.

我以root $ ssh root@my.server.url 的身份登录服务器,然后进入授权的dokku用户密钥文件夹 $ cd /home/dokku/.ssh /

I logged in to my server as the root $ ssh root@my.server.url then made my way to the dokku users authorized keys folder $ cd /home/dokku/.ssh/

然后我打开该现在,在此文件中,$ nanoauthorized_keys 已经有一个密钥,但是您可能没有任何密钥。无论哪种情况,我都将ssh-key粘贴到该文件中并退出该文件。

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.

从那里开始,如果我使用dokku用户进行推送,那么现在的效果非常好。要求输入密码,因为它已经可以识别我的ssh密钥了。
顺便说一句,有一种方法可以简化所有步骤,将其简化为两个步骤,但有时我喜欢很长一段路要走,以确保密钥实际上已将其写入文件中。

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.

这篇关于Dokku在尝试git push时要求输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆