使用【SSH **】方式访问git
本文以阿里云代码托管为例。
阿里代码托管网址:https://code.aliyun.com
阿里公钥设置网址:https://code.aliyun.com/profile/keys
Windows生成公私钥
在cdm命令窗口输入
ssh-******
连按三次回车,结果如下。(三次回车分别对应,文件名,密码,建议都使用默认值,特别是密码,否则,每次使用git都会要求输入密码)
查看公钥
用记事本打开文件【C:\Users\x1c\.ssh\id_rsa.pub】并配置到阿里代码托管中,或者发送给git管理员。
阿里代码托管配置
https://code.aliyun.com/profile/keys
Max生成公私钥
Max是自带SSH命令的。
查看是否安装ssh命令
$ whereis ssh
ssh对应的进程
$ ps aux | grep ssh
查看本地是否存在SSH-Key
$ ls -al ~/.ssh
如果不存在目录则需要生成sshkey
$ ssh-****** -t rsa -C "[email protected]"