GitHub ssh失敗Permission denied (publickey)

在執(zhí)行命令時(shí)報(bào)錯(cuò)ssh -T git@github.com

$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).

使用命令查看 ssh -v git@github.com

$ ssh -v git@github.com
OpenSSH_7.6p1, OpenSSL 1.0.2l  25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Wang/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version libssh_0.7.0
debug1: no match: libssh_0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/Wang/.ssh/known_hosts:1
Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/Wang/.ssh/id_rsa
debug1: Trying private key: /c/Users/Wang/.ssh/id_dsa
debug1: Trying private key: /c/Users/Wang/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/Wang/.ssh/id_ed25519
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

最后發(fā)現(xiàn)使用.ssh目錄下的幾個(gè)private key 女仰,把自己私鑰的文件名改成第一個(gè)Trying private key的名字id_rsa
然后在重新執(zhí)行就能連上了

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子现斋,更是在濱河造成了極大的恐慌转唉,老刑警劉巖劝堪,帶你破解...
    沈念sama閱讀 216,372評(píng)論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件贬墩,死亡現(xiàn)場(chǎng)離奇詭異呀闻,居然都是意外死亡精肃,警方通過(guò)查閱死者的電腦和手機(jī)秤涩,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)司抱,“玉大人筐眷,你說(shuō)我怎么就攤上這事∠澳” “怎么了匀谣?”我有些...
    開(kāi)封第一講書人閱讀 162,415評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵照棋,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我武翎,道長(zhǎng)烈炭,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書人閱讀 58,157評(píng)論 1 292
  • 正文 為了忘掉前任宝恶,我火速辦了婚禮符隙,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘垫毙。我一直安慰自己霹疫,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,171評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布综芥。 她就那樣靜靜地躺著丽蝎,像睡著了一般。 火紅的嫁衣襯著肌膚如雪毫痕。 梳的紋絲不亂的頭發(fā)上征峦,一...
    開(kāi)封第一講書人閱讀 51,125評(píng)論 1 297
  • 那天,我揣著相機(jī)與錄音消请,去河邊找鬼栏笆。 笑死,一個(gè)胖子當(dāng)著我的面吹牛臊泰,可吹牛的內(nèi)容都是我干的蛉加。 我是一名探鬼主播,決...
    沈念sama閱讀 40,028評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼缸逃,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼针饥!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起需频,我...
    開(kāi)封第一講書人閱讀 38,887評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤丁眼,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后昭殉,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體苞七,經(jīng)...
    沈念sama閱讀 45,310評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,533評(píng)論 2 332
  • 正文 我和宋清朗相戀三年挪丢,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了蹂风。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片唉俗。...
    茶點(diǎn)故事閱讀 39,690評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡丑勤,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出矛紫,到底是詐尸還是另有隱情,我是刑警寧澤撵渡,帶...
    沈念sama閱讀 35,411評(píng)論 5 343
  • 正文 年R本政府宣布融柬,位于F島的核電站,受9級(jí)特大地震影響姥闭,放射性物質(zhì)發(fā)生泄漏丹鸿。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,004評(píng)論 3 325
  • 文/蒙蒙 一棚品、第九天 我趴在偏房一處隱蔽的房頂上張望靠欢。 院中可真熱鬧,春花似錦铜跑、人聲如沸门怪。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 31,659評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)掷空。三九已至,卻和暖如春囤锉,著一層夾襖步出監(jiān)牢的瞬間坦弟,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 32,812評(píng)論 1 268
  • 我被黑心中介騙來(lái)泰國(guó)打工官地, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留酿傍,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,693評(píng)論 2 368
  • 正文 我出身青樓驱入,卻偏偏與公主長(zhǎng)得像赤炒,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子亏较,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,577評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容