zoukankan      html  css  js  c++  java
  • Mac环境下终端(Terminal)用ssh 连接服务器问题 Received disconnect from 120.55.x.x: 2: Too many authentication failures for root

    由于这台Mac配置git生成公钥后,ssh连接就出现来这个问题

    Received disconnect from 120.55.x.x: 2: Too many authentication failures for root

    出现后只需要在 ssh 后面 加上 -o PubkeyAuthentication=no 这个参数,连接正常。

    如果不想每次加-o参数就添加个配置文件(默认没有) ~/.ssh/config

    PreferredAuthentications password

    测试连接正常。

    -----------------------------分割线----------------------------------

    回头再push origin的时候又出现了这样的问题

    git push origin master

    Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.

    Permission denied (publickey).

    fatal: Could not read from remote repository.

     

    Please make sure you have the correct access rights

    and the repository exists.


    -----------------------------分割线----------------------------------

       vi ~/.ssh/config

       注释掉

    #PreferredAuthentications password
    提交正常

    git push origin master

    Counting objects: 3, done.

    Delta compression using up to 4 threads.

    Compressing objects: 100% (3/3), done.

    Writing objects: 100% (3/3), 992 bytes | 0 bytes/s, done.

    Total 3 (delta 0), reused 0 (delta 0)

    To git@github.com:l496501043/first.git

       d0cff78..8399039  master -> master

    -----------------------------分割线----------------------------------

           又回去 ssh 120.55.x.x -l root

     

          连接不上,继续push origin到github也正常

           

          那就接着加参数连接ssh 120.55.x.x -l root -o PubkeyAuthentication=no

    -----------------------------分割线----------------------------------

    -----------------------------分割线----------------------------------

    -----------------------------分割线----------------------------------
     
  • 相关阅读:
    Windows Server 2012 R2 里面如何安装Net Framework 3.5
    虚拟机网络驱动(共享文件夹)不见了的解决方案-适用于win7~win10 and Windows Server 2008~Windows Server 2012R2
    在计算机 . 上没有找到服务 WAS
    免费获取WP之类的开发者权限或免费使用Azure 2015-10-19
    颠覆你的认知,带你领略史上最为齐全的微软黑科技之旅
    【技巧】只利用 Visual Stdio 自带的工具这么找父类?
    网站定位之---根据IP获得区域
    06.移动先行之谁主沉浮----我的代码我来写(Xaml的优势)
    05.移动先行之谁主沉浮----小应用的美化
    04.移动先行之谁主沉浮----XAML的探索
  • 原文地址:https://www.cnblogs.com/liugx/p/5118622.html
Copyright © 2011-2022 走看看