简体   繁体   English

密码是否需要与git托管提供商密码相同

[英]Does passphrase need to be the same as the git hosting provider password

I use ssh-keygen -T rsa to create a public key for accessing my git hosting provider. 我使用ssh-keygen -T rsa创建用于访问我的git托管提供程序的公共密钥。

a) Does the passphrase entered here should be the same as the git hosting provider account password? a)此处输入的密码短语应与git hosting provider帐户密码相同吗? Enter passphrase (empty for no passphrase): Enter same passphrase again: 输入密码(空为无密码):再次输入相同的密码:

b) Can I use an empty password in the above step b)我可以在上述步骤中使用空密码吗

c) What is the significance of providing " -C " option, if given the key contains this value else it contains the domainname\\accountname in the key c)提供“ -C ”选项的意义是什么,如果给定密钥包含此值,否则它包含密钥中的域名\\帐户名

d) I connect to 2 different git hosting providers (github and a private git hosting vendor). d)我连接到2个不同的git托管提供商(github和一个私人git托管提供商)。 So I am assuming you have to create 2 keys OR having 1 key is enough for both the providers? 因此,我假设您必须创建2个密钥,或者对于两个提供者来说拥有1个密钥就足够了? Note: id_rsa.pub will erase the original copy if we create it twice. 注意:如果我们创建两次,id_rsa.pub将删除原始副本。

Kindly clarify 请澄清

a.) the passphrase of a SSH key is only interesting to you, no one else can or should see it. a。)SSH密钥的密码短语让您感兴趣,没有其他人可以或不应看到它。 So no, it need not be the same as your hosting provider password. 因此,不需要,它不必与您的托管服务提供商密码相同。

b.) Yes, the passphrase can be empty, but that means that anyone who can read the file can use it to be authenticated as you. b。)是,密码短语可以为空,但这意味着可以读取该文件的任何人都可以使用该文件来对您进行身份验证。 This severly reduces the security. 严重降低了安全性。

c.) -C specifies a comment. c。)- -C指定注释。 It has no effect . 没有效果 It's simply there so that you can find out for which use you created a specific key if you come back after some time. 它只是在这里,以便您在一段时间后返回时可以找出创建特定密钥的用途。 It's not a bad idea to add what you use it for here. 在此处添加您要使用的功能并不是一个坏主意。

d.) you can use a single key for both. d。)您可以同时使用单个键。 Again, it's a tradeoff between security and ease-of-use: using a single key means only a single set of files to backup and only a single passphrase to remember, but it also means that once it's been compromised, both accounts are compromised at once. 同样,这是安全性和易用性之间的折衷:使用单个密钥意味着仅备份一组文件,并且仅记住一个密码短语,但这也意味着一旦被破坏,两个帐户都将在一旦。

Also note that none of this is related to git, it's all basic SSH information. 还要注意,这与git无关,它们都是SSH的基本信息。 So it applies to everything else that uses SSH keys as well. 因此,它也适用于使用SSH密钥的所有其他内容。

Password does not need to be the same as on the host provider, it can be empty but that is not adviced. 密码不必与主机提供者上的密码相同,可以为空,但建议不要这样做。 One key is enough for both providers. 对于两个提供商来说,一把钥匙就足够了。 Consider using ssh-agent to manage keys! 考虑使用ssh-agent管理密钥!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM