git 更新密码之后出现异常(雾)

git 更新密码之后出现了问题(雾)

记录一下今天的沙雕操作
  github密码太简单被强行更新,然后git clone按照平时那样用,输入新的密码,提示没有权限

wen@xiaobao /c/1111111/home
$ git clone [email protected]:XXXXXXXX/XXXX.git
Cloning into 'cppPractice'...
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

参考了下搜到的在 控制面板\用户帐户\凭据管理器,Windows凭据改掉git的密码。
  然而还是不行。是不是ssh的问题?把.ssh里面的id_rsa.pub内容拷贝到github网页上的settings->ssh->SSH and GPG keys->SSH keys->New SSH key里面,提示Key is already in use。
  找了个测试ssh连接的命令:

wen@xiaobao /c/1111111/home
$ ssh -T [email protected]
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
[email protected]: Permission denied (publickey).

照常输了三次新的github密码,Permission denied (publickey),换了个长一点的命令

wen@xiaobao /c/1111111/home
$ ssh -vT [email protected]
OpenSSH_8.0p1, OpenSSL 1.1.1c  28 May 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: Connection established.
debug1: identity file /c/Users/wen/.ssh/id_rsa type 0
debug1: identity file /c/Users/wen/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_dsa type -1
debug1: identity file /c/Users/wen/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/wen/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/wen/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_xmss type -1
debug1: identity file /c/Users/wen/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version babeld-dae25663
debug1: no match: babeld-dae25663
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> 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/wen/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
debug1: Will attempt key: /c/Users/wen/.ssh/id_dsa
debug1: Will attempt key: /c/Users/wen/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/wen/.ssh/id_ed25519
debug1: Will attempt key: /c/Users/wen/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
debug1: Server accepts key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
debug1: Trying private key: /c/Users/wen/.ssh/id_dsa
debug1: Trying private key: /c/Users/wen/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/wen/.ssh/id_ed25519
debug1: Trying private key: /c/Users/wen/.ssh/id_xmss
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).

太长了看不懂,大概就是连接成功了,不是没有reply的问题。
  ssh目录下id_rsa,id_rsa.pub,known_hosts仨文件齐全,也不是缺少私钥id_rsa问题。
  ssh 没有权限,看到这样一句话:
git 更新密码之后出现异常(雾)_第1张图片
难道说私钥id_rsa的密码不是github的密码???试了一下之前的ssh密码。

wen@xiaobao /c/1111111/home
$ ssh -vT [email protected]
OpenSSH_8.0p1, OpenSSL 1.1.1c  28 May 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: Connection established.
debug1: identity file /c/Users/wen/.ssh/id_rsa type 0
debug1: identity file /c/Users/wen/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_dsa type -1
debug1: identity file /c/Users/wen/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/wen/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/wen/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/wen/.ssh/id_xmss type -1
debug1: identity file /c/Users/wen/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version babeld-dae25663
debug1: no match: babeld-dae25663
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> 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/wen/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
debug1: Will attempt key: /c/Users/wen/.ssh/id_dsa
debug1: Will attempt key: /c/Users/wen/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/wen/.ssh/id_ed25519
debug1: Will attempt key: /c/Users/wen/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
debug1: Server accepts key: /c/Users/wen/.ssh/id_rsa RSA SHA256:iIg4WRUuM6bSmvbvW9FUbP5Q2m+nMSHC2jCE03CT4CI
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.255.112]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
Hi thenamehasbeentake! You've successfully authenticated, but GitHub does not provide shell access.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3104, received 2364 bytes, in 2.3 seconds
Bytes per second: sent 1379.3, received 1050.5
debug1: Exit status 1

只输了一次密码,原来让我输三次密码是因为密码输错错了…
一句话概括:

wen@xiaobao /c/1111111/home
$ ssh -T [email protected]
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Hi thenamehasbeentake! You've successfully authenticated, but GitHub does not provide shell access.

试一试push:

wen@xiaobao /c/1111111/home/gitPractice (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

wen@xiaobao /c/1111111/home/gitPractice (master)
$ git push origin master
Enter passphrase for key '/c/Users/wen/.ssh/id_rsa':
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 255 bytes | 127.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To github.com:thenamehasbeentake/gitPractice.git
   043500d..71489a0  master -> master

搞了半天原来是理解错了passphrase for id_rsa的含义,这个密码跟git的账号密码不是同一个,当初配环境的时候没仔细看,弄出了这样让人啼笑皆非的睿智操作。  
  震惊,git密码更新导致ssh失效?ssh配置连接正常却permission denied?这背后到底是道德的沦丧还是人性的扭曲。


总结一下:git密码更新之后,大概只需要改一下凭据就够了…

你可能感兴趣的:(睿智操作)