背景
由于想测试一下 SSH Key 创建的路径(.ssh 目录路径)对于不同位置 git 项目是否有效。
比如,.ssh 默认在 C:\[users]\[username] 目录下,而项目 project 在 D:\ 目录。测试结果是依然有效,即 .ssh 在 C:\[users]\[username] 目录下时,在其他位置 push 时无需进行密码认证(测试时项目以 SSH clone)。
PS:测试前已经将远程仓库托管平台公钥配置好。
事件1(file to save the key)
在本地创建 SSH Key 过程中:
$ ssh-keygen -t rsa -C"email@xxx.xxx"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/[usrname]/.ssh/id_rsa):
当在后面输入其它路径时发现不能键入.ssh,唯独默认路径中可包含 .ssh。不过只要路径中不包括 .xxx 即可生成 SSH Key。
事件2(the authenticity of host...)
首次 clone(SSH)时报错
The authenticity of host 'gitee.com (xxx.x