git clone heroku ssh权限被拒绝 [英] git clone heroku ssh permission denied

查看:136
本文介绍了git clone heroku ssh权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下是我迄今为止所做的工作。我只是买了一台新电脑,并试图克隆我的heroku项目。我没有包含跟踪信息,但所有内容都保存在正确的位置,并且这些功能正常运行。

 > > sudo ssh-keygen 
>> heroku键:添加
>> sudo git clone -o heroku git@heroku.com:myapp.git

在/Users/macuser/Sites/shwagr/shwagr/.git/中初始化的空Git存储库
权限被拒绝(publickey )。

然后我听说通过ssh bash来完成它。

 > ssh-agent bash 
> ssh-add〜/ .ssh

权限0777 for'/ Users / macuser / .ssh'太开放了。
建议您的私钥文件不能被其他人访问。
这个私钥将被忽略。

什么? OK爸爸..

 >> sudo chmod 700〜/ .ssh 
>> ssh-agent bash
>> ssh-add〜/ .ssh
为/Users/macuser/.ssh输入密码短语:
密码不好,再次尝试/Users/macuser/.ssh:
密码不好,再次尝试/Users/macuser/.ssh:
密码不好,再次尝试/Users/macuser/.ssh:
密码不好,再次尝试/ Users / macuser / .ssh:
错误的密码,请再次尝试/Users/macuser/.ssh:
错误的密码,请再次尝试/Users/macuser/.ssh:

不知道这里的密码是什么,但确定不是我设置的。如果我只是按回车/输入,它会退出,但这并没有给我它的工作效果。因此,它仍然不允许我克隆存储库。



有什么想法?

UPDATE
我进入了我的〜/ .ssh文件并执行 ssh-keygen -t rsa ,并且我创建了一个名为。然后我 heroku keys:成功添加love.pub

然后我去git clone ..

  sudo git clone -o heroku git@heroku.com:mysite.git 

在/用户/ macuser /网站/ shwagr / shwagr / .git /
权限被拒绝(publickey)。

UPDATE 2



我删除了〜/ .ssh,并且在没有 sudo 的情况下重新创建了它。然后,我删除了我今天创建的所有密钥,并将其重新启动。



同样的错误。



更新3

 >>> heroku键

No这台电脑的钥匙。

>> sudo heroku keys

此计算机没有密钥

>>>> heroku keys:add

>> heroku键

ssh-rsa AAAA ... J67lw == macuser@Mac-Users-MacBook-Pro.local

将这些键与我的键相比较:它们是相同的。 :D



Permission Denied。



尝试4



heroku键:清除
rm -rf〜/ .ssh
mkdir〜/ .ssh
cd〜/ .ssh
ssh-keygen -t rsa
heroku keys:添加
cd / Users / macuser / Sites /
sudo git clone -o heroku git @ heroku。 com:shwagr.git



失败。

致命:远程终端意外挂断

巨大更新



刚发现git repo实际上是空的。这只是一个符号链接(当你附加一个真实的域名时,它仍然使用旧的域名作为真正的回购)。所以当我将Heroku的默认名称之一(如smooth-buttery-back-52.git)拉出来时,它就起作用了,实际上就是我的存储库。

解决方案

 >> sudo ssh-keygen 

NO。放下sudo。这将为root用户创建密钥,而不是您的用户。那么除非有一些奇怪的原因,否则你想使用root。但是,你需要在 sudo 中使用该键的所有相关命令前缀。


I just bought a new computer and I am trying to clone my heroku project on it.

Here's what I've done so far. I didn't include the trace, but everything was saved in the right place, and the functions ran without errors.

>> sudo ssh-keygen
>> heroku keys:add
>> sudo git clone -o heroku git@heroku.com:myapp.git

Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
Permission denied (publickey).

Then I heard about doing it through ssh bash..

>ssh-agent bash
>ssh-add ~/.ssh

Permissions 0777 for '/Users/macuser/.ssh' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.

What? Ok Dad..

>>sudo chmod 700 ~/.ssh
>>ssh-agent bash
>>ssh-add ~/.ssh
Enter passphrase for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh: 
Bad passphrase, try again for /Users/macuser/.ssh:

Not sure what the password here is, but it sure wasn't me who set this one. If I simply press return/enter, it exits out, but that doesn't give me the impression it worked. And consequentially, it still doesn't allow me to clone the repository.

Any ideas?

UPDATE I went into my ~/.ssh file and performed ssh-keygen -t rsa and i made a new key called love. Then I heroku keys:add love.pub successfully.

Then I went to git clone..

sudo git clone -o heroku git@heroku.com:mysite.git

Initialized empty Git repository in /Users/macuser/Sites/shwagr/shwagr/.git/
Permission denied (publickey).

UPDATE 2

I deleted ~/.ssh, and recreated it without sudo. Then I removed all my keys I had created today off of heroku , and restarted the process.

Same error.

Update 3

>>heroku keys

  No Keys for this computer.

>>sudo heroku keys

  No Keys for this computer

>>heroku keys:add

>>heroku keys

ssh-rsa AAAA...J67lw== macuser@Mac-Users-MacBook-Pro.local

Compared these keys to my keys : They are identical. :D

Permission Denied.

Attempt 4

heroku keys:clear rm -rf ~/.ssh mkdir ~/.ssh cd ~/.ssh ssh-keygen -t rsa heroku keys:add cd /Users/macuser/Sites/ sudo git clone -o heroku git@heroku.com:shwagr.git

Failed.

fatal: The remote end hung up unexpectedly

Huge Update

Just found out that git repo is actually empty. And it's just a symbolic link ( when you attach a real domain to it it still uses the old one as the real repo ). So when I pulled one of Heroku's default names like smooth-buttery-back-52.git , it pulled and worked, and was actually my repository.

解决方案

>> sudo ssh-keygen

NO. Drop the sudo. That will create keys for the root user, not your user. Well unless of course for some strange reason you want to use root. But then you need to prefix all related commands that are going to use this key with sudo.

这篇关于git clone heroku ssh权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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