zoukankan      html  css  js  c++  java
  • Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

    第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊。

    排查先看看能不能解析,

    1.先 ping https://github.com  

    把ip添加到 host :    sudo vi /etc/hosts  (添加下面第三行)

    127.0.0.1  localhost  localhost.localdomain  VM-0-6-ubuntu
    127.0.1.1       TENCENT
    192.30.255.113  github.com # 添加ip
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    192.30.255.113 github.com
    ~                         

    2.如果不行的话看看自己有没有输入错误的创库地址

    查看配置

    cat .git/config

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "origin"]
            url = git@github:cuzz1/flask.git   # 错误的
            url = git@github.com:cuzz1/flask.git
            fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
            remote = origin
            merge = refs/heads/master

    3. 现在提交还出现

    那就是github 上的ssh key 添加错了,我们用ssh-keygen -t rsa -C "xxxx@163.com" 会生成在很多目录下,比如root/.ssh、 /home/ubuntu/.ssh 都有ras_id.pub 

    所以我们不能添加错了。必须在 ~/.ssh目录下  才有用,要是当前目录,把  ~/.ssh/ras_id.pub 拷到github上就可以了。

    现在提交就可以了。

    感谢军哥的帮忙 ,微信公众号 Python之禅

  • 相关阅读:
    TCP校验和
    Python8 数据库基础
    Python7 TCPIP协议与抓包
    Python6 线程与进程、网络编程、生成器与迭代器、协程、异步IO
    python2 变量与数据类型
    Python10 前端基础与爬虫
    Python11 Scrapy框架基础
    python3 函数、运算符与数据类型的常用方法
    Python9 数据库进阶
    python1 简介
  • 原文地址:https://www.cnblogs.com/cuzz/p/8214712.html
Copyright © 2011-2022 走看看