有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,GitHub存储库存在,我不知道现在该做什么。
> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
当前回答
如果您已经创建了SSH密钥,但仍然报错,这是因为您需要给用户读写要克隆到的文件夹的权限。sudo chmod 777 <your_folder_name_here>"。 当然,这是在生成SSH密钥之后,仍然会得到这个错误。希望这对未来的用户有所帮助。
Edit
如果你使用git bash,在Windows中使用admin来添加
其他回答
我知道这个问题。添加ssh密钥后,也添加您的ssh密钥到ssh代理(来自官方文档)
ssh-agent -s
ssh-add ~/.ssh/id_rsa
一切正常工作后,git可以查看适当的密钥,以前不能。
你在你的~/中创建了配置文件吗?ssh目录吗?它应该有这样的内容:
Host github.com
IdentityFile ~/.ssh/github_rsa
假设您创建了一个名为github_rsa的ssh密钥
然后上传到GitHub…
注意:如果~/中有多个键(2个或更多),则必须采用这种显式配置方式。ssh /目录。如果你不这样指定密钥,那么第一个密钥将被用于github身份验证,因此它取决于密钥文件名。
我最近也遇到了同样的问题。如果您需要立即修复,这可能会有所帮助,但每次重新启动系统时都需要这样做
在终端执行:ssh-add ~/.ssh/id_rsa
输入系统密码就可以了。
如果您正在使用windows -10,请遵循此说明。这对我很管用。
以管理员身份打开终端 执行命令:"ssh-keygen"。它生成一个ssh密钥,并显示创建密钥的文件夹。检查我的图像 复制生成的ssh密钥 点击“新建SSH键按钮”并粘贴“SSH键”,最后“点击添加按钮”
如果您在连接您的企业Github帐户时遇到问题,请按照以下步骤进行
解决方案1
ERROR: git@github.com: Permission denied (public key). fatal: Could not read
from remote repository. Please make sure you have the correct access
rights
解决方案(OSX)
打开终端并执行以下命令 $ CD ~ $ sudo su ssh - keygen美元 输入要保存密钥的文件(/var/root/.ssh/id_rsa): $ id_rsa Enter passphrase(空表示没有passphrase): $ hit Enter 再次输入相同的密码:$ hit Enter $ CD ~/.ssh $ cat id_rsa.pub 复制显示内容。 打开GitHub单击您的配置文件图标设置>SSH和GPC密钥 单击新的ssh键按钮 输入您复制的任何标题和键 检查您的问题是否已经解决
解决方案2
ERROR 2: remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: See https://github.compnay.com/settings/tokens or https://github.compnay.com/settings/ssh
fatal: unable to access 'https://github.company.com/repo/app.git/': The requested URL returned an error: 403
密码认证支持已于2021年8月13日移除。请改用个人访问令牌。
https://namespaceit.com/blog/remote-support-for-password-authentication-was-removed-on-august-13-2021-please-use-a-personal-access-token-instead