您的位置:首页 > 大数据 > 人工智能

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

2016-01-10 16:05 561 查看
由于这台Mac配置git生成公钥后,ssh连接就出现来这个问题

Receiveddisconnectfrom120.55.x.x:2:Toomanyauthenticationfailuresforroot

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

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

PreferredAuthenticationspassword

测试连接正常。

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

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

gitpushoriginmaster

Warning:PermanentlyaddedtheRSAhostkeyforIPaddress'192.30.252.128'tothelistofknownhosts.

Permissiondenied(publickey).

fatal:Couldnotreadfromremoterepository.

Pleasemakesureyouhavethecorrectaccessrights

andtherepositoryexists.

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

vi~/.ssh/config

注释掉

#PreferredAuthenticationspassword
提交正常

gitpushoriginmaster

Countingobjects:3,done.

Deltacompressionusingupto4threads.

Compressingobjects:100%(3/3),done.

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

Total3(delta0),reused0(delta0)

Togit@github.com:l496501043/first.git

d0cff78..8399039master->master

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

又回去ssh120.55.x.x-lroot

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

那就接着加参数连接ssh120.55.x.x-lroot-oPubkeyAuthentication=no

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

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

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


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: