具体过程可以直接看 https://blog.csdn.net/u013778905/article/details/83501204
1)ssh密钥的存放位置是可以自定义的。如果存放位置不是默认位置,不在.ssh文件中,那么通过cd ~/.ssh 就无法确定是否已经生成了 ssh密钥。 反过来,为了能够不忘记原本的密钥,推荐在默认位置生成密钥。
2)ssh是否设置密码 如果设置了密钥,则每次使用ssh 密钥时,都需要进行密码验证。
GitHub的解决方法就是将SSH 由SSH agent管理。 通过$ ssh-add ~/.ssh/id_rsa 将密钥添加到SSH agent后,在该会话中无须再输入SSH 密钥。 但是 这种解决方案需要ssh-agent 已经启动。如果使用随 GitHub Desktop 一起安装的 Git Shell,则 运行Git Shell时ssh-agent 会默认自动运行。但是如果是 Git 自带的Git Bash,则需要通过> $ eval $(ssh-agent -s)先手动启动SSH agent ,或者根据 GitHub的教程设置Git Bash运行时自动启动ssh-agent如果是通过IDEA,则IDEA软件会接管ssh密钥管理3)在使用SSH的过程中,可能会出现警告 注:图片来源为https://help.github.com/cn/articles/testing-your-ssh-connection 截图
如果出现了如上图的警告,可以看跟下面网页 中 key fingerprints 比较,但是一般不会有问题 https://help.github.com/en/articles/githubs-ssh-key-fingerprints?query=GitHub's SSH key fingerprints