美文网首页
mac配置多个sshkey遇到的问题

mac配置多个sshkey遇到的问题

作者: 泛坷 | 来源:发表于2021-01-15 20:46 被阅读0次

    问题一

    ssh: Could not resolve hostname github: nodename nor servname provided, or not known
    fatal: Could not read from remote repository.
    

    问题二

    ssh: connect to host github port 22: Connection refused
    

    解决方法
    cd ~/.ssh/
    ls查看是否有config文件
    如果没有touch一个config文件

    重点来了「将id_rsa_github替换成你自己的,直接复制」

    #这个是配置gitee
    Host gitlab.com
    User gitlab
    HostName gitlab.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa_ gitlab
    Port 443
    
    #这个是配置的github
    Host github.com
    User git
    Hostname ssh.github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa_github 
    Port 443
    

    测试是否成功链接

    way1: ssh -T git@github.com (域名)
    way2:  ssh -v git@github.com (域名)「这个跑到仔细」
    

    网上的配置etc/host对于我配置多个sshkey遇到这个问题每个卵用

    相关文章

      网友评论

          本文标题:mac配置多个sshkey遇到的问题

          本文链接:https://www.haomeiwen.com/subject/lmawaktx.html