在 Git 中更改 SSH 密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8739964/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change SSH password in Git
提问by Chris Sim
Let's say my SSH username is mygituser
and my password is mygitpass
The new password should be mygitnewpass
. How do I change my SSH password in Git?
假设我的 SSH 用户名是mygituser
,我的密码是mygitpass
新密码应该是mygitnewpass
。如何在 Git 中更改我的 SSH 密码?
采纳答案by Chris Sim
I just had to log in using:
我只需要使用以下方法登录:
ssh my_user@
and write
和写
passwd
so all you will do:
所以你要做的就是:
ssh [email protected]
passwd
mygitpass
mygitnewpass
mygitnewpass
回答by zoul
I don't think that Git itself has anything like access control, or users and passwords. These have to do with the “transport layer” that you access your Git remote through. Most often Git uses SSH as a transport layer, so that you've got to have an SSH account on the machine hosting the remote and if you want to change your “Git password”, you really want to change your SSH password on that box (or the passphrase of your private key, as Sjoerd points out). In other words, the answer depends on how you access the Git remote.
我不认为 Git 本身具有访问控制或用户和密码之类的功能。这些与您访问 Git 远程的“传输层”有关。大多数情况下,Git 使用 SSH 作为传输层,因此您必须在托管远程设备的机器上拥有一个 SSH 帐户,并且如果您想更改“Git 密码”,您真的想在该机器上更改您的 SSH 密码(或您的私钥的密码,正如 Sjoerd 指出的那样)。换句话说,答案取决于您如何访问 Git 远程。