git - Coding.net的ssh设置问题
ringa_lee
ringa_lee 2017-05-02 09:40:07
0
1
787

自己之前很少用ssh这种方式连接git仓库,但是近期的项目想借助webhook尝试自动部署,就需要在vps上面通过ssh链接git,进行pull操作。

按照我的理解,产生一个ssh密钥对后,私钥放到vps的.ssh/id_xxx下,公钥通过coding.net上传即可。

但是发现coding.net的ssh公钥有两种类型,按照帮助页面的说法,一种验证用户,一种是部署公钥用来保证只读权限,这两个公钥还不能通用,那么问题来了,我在vps上面需要生成两个ssh密钥,分别在coding.net中添加到账户公钥和部署公钥吗?同理,如果存在本地存在俩个私钥,coding.net上传了一个账户公钥和部署公钥,那么coding.net采用哪一个?

还有,虽然一个部署公钥可以用到多个项目,但是我发现公钥上传成功后,就看不到内容,这样,过一阵子vps如果需要部署新的项目,而老的部署公钥没有保存的话是不是就必须弄一个新的密钥?

另外,产生了ssh密钥后,还需要ssh-add操作吗?

补充,账户公钥和部署公钥不能通用:

ringa_lee
ringa_lee

ringa_lee

reply all(1)
某草草

You don’t need a deployment key. The deployment key is for deployment and is not necessary if your users are all on the machine.

I don’t know why coding.net can’t see the public key. Both GitHub and BitBucket public keys are publicly visible. In addition, the public key can be generated from the private key. But the public key and the private key stay together. Why would you forget one of them?

I never ssh-add unless I need to use ssh-agent.

I feel like you rarely use ssh.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!