zoukankan      html  css  js  c++  java
  • git bash 学习2 --更改url 重置密钥 Permission denied (publickey)问题

    在今天的上传过程中,我意外地遇到了一个问题,,每一次push都会出现

    $ git push 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.
    

    大致意思就是我登不上自己的账户了?(发生了什么???)

    冷静分析,全部和以往的处理方式一样

    git init 建立仓库, add 添加 , commit 提交, 然后remote add 添加远程仓库位置

    就在我觉得万无一失之时,出来这么个神奇问题

    内事不决问百度,在经由度娘后了解了一种方法

    重置公钥, 首先,将你原本的.ssh文件取出(就是你曾经放公钥的地方)

    (提示:windows默认放在user(<在文件管理器中文显示为用户>)文件夹下的 ****(你的微软账户)里,认真找出 .shh 文件夹,如果乱放了,可以百度一下命令行删除方式)

    然后 备份, 删除

    然后,在gitbash输入

    ssh-keygen -t rsa
    

     一路三次回车(默认位置如上,密码为空,再次输入为空)

    然后你发现又出来了, .shh文件夹,然后熟悉的id_rsa.pub公钥

    然后按照http://www.cnblogs.com/Phoenix-blog/p/7748314.html 里的方法重新弄一遍

    至此,为了验证连接正常,输入

    ssh git@github.com
    

     然后服务器回答我

    The authenticity of host 'github.com (***.**.***.***)' can't be established.
    
    RSA key fingerprint is **************************************** Are you sure you want to continue connecting (yes/no)? y //输入了一个yes,打星号是一些私人信息的文字,字数不一定对 
    Please type 'yes' or 'no': yes
    Warning: Permanently added 'github.com,*********' (RSA) to the list of known hosts. PTY allocation request failed on channel 0 Hi ******! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.

     嗯,完美,然后,再次,push

    what??? 还是不行

    于是,我开始查看另一些详细信息,输入

    cat .git/config
    

     然后发现一个严重问题。我的url多打了一个git。。。 用命令

    git remote rm origin
    git remote add origin ********(远程仓库位置)
    

     换了回来,果然成了, 应了git官方文档的话

     打字真的累,我们都知道,但是别打错了。。。。。。

    附文档出处:https://help.github.com/articles/error-permission-denied-publickey/#platform-windows

  • 相关阅读:
    第一节,Django+Xadmin打造上线标准的在线教育平台—创建用户app,在models.py文件生成3张表,用户表、验证码表、轮播图表
    Tensorflow 错误:Unknown command line flag 'f'
    Python 多线程总结
    Git 强制拉取覆盖本地所有文件
    Hive常用函数 傻瓜学习笔记 附完整示例
    Linux 删除指定大小(范围)的文件
    Python 操作 HBase —— Trift Trift2 Happybase 安装使用
    梯度消失 梯度爆炸 梯度偏置 梯度饱和 梯度死亡 文献收藏
    Embedding 文献收藏
    深度学习在CTR预估中的应用 文献收藏
  • 原文地址:https://www.cnblogs.com/Phoenix-blog/p/8443525.html
Copyright © 2011-2022 走看看