SSH公钥生成无法使用问题

配置个GIT SSH公钥,一直验证不对

clone一直提示

Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open options and verify that you're signed in with an account that has permission to access this repository.

后来查资料,有人说是因为没 配置以下信息

git config --global user.name “用户名”
git config --global user.email “邮箱”

而是直接在配置那里写邮箱和用户名,生成的公钥匙直接显示我的邮箱,后来拿去用不了;后来我有一步一步写的时候生成的公钥其实最后显示的并不是邮箱,而是本机名,当时我一直以为显示邮箱是对的

尝试了以上方法还是不行

最终在廖雪峰老师的论坛里找到了解决方法

$ ssh -T [email protected]
The authenticity of host 'gitee.com (218.11.0.86)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitee.com,218.11.0.86' (ECDSA) to the list of known hosts.
Hi Anonymous! You've successfully authenticated, but GITEE.COM does not provide shell access.
Note: Perhaps the current use is DeployKey.
Note: DeployKey only supports pull/fetch operations

是自己执行的时候,没有注意到,这里还需要填写yes。才能添加到本地SSH信任列表。

【切记】首次使用需要确认并添加主机到本机SSH可信列表

最后终于完美解决

猜你喜欢

转载自blog.csdn.net/lj81020302/article/details/83178988