免密提交
-
1 生成公钥对
cd #回到家目录 ssh-keygen -t rsa -C "自己的邮箱" id_rsa 私钥 id_rsa.pub 公钥
-
2 将公钥添加到码云服务器上
复制id_rsa.pub的内容 码云 ----> 个人设置-->ssh公钥,将复制的内容黏贴到“公钥内容”中 选中永久有效 添加
-
3.测试连接
ssh -T git@git.coding.net The authenticity of host 'git.coding.net (118.25.166.124)' can't be established. RSA key fingerprint is SHA256:jok3FH7q5LJ6qvE7iPNehBgXRw51ErE77S0Dn+Vg/Ik. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'git.coding.net' (RSA) to the list of known hosts. Coding 提示: Hello maobaobao, You've connected to Coding.net via SSH. This is a deploy key. maobaobao,你好,你已经通过 SSH 协议认证 Coding.net 服务,这是一个部署公钥
-
4 使用项目的ssh地址,可以clone或init/remote add