美文网首页
Warning: Permanently added 'gith

Warning: Permanently added 'gith

作者: Superman168 | 来源:发表于2024-08-10 09:30 被阅读0次

执行flutter pub get的时候,报这个错误:

Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

解释:
这个警告信息表示SSH客户端在第一次连接到服务器时,会将服务器的主机名和主机密钥(在这个例子中是ED25519算法)添加到本地的known_hosts文件中,以便在后续连接时验证服务器的真实性,防止"中间人"攻击。这个信息本身不是一个错误,而是一个通知,告诉用户发生了什么。

  1. 可能是没有输入生成id_rsa的密码
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Enter passphrase for key '/Users/superman/.ssh/id_rsa':

  2. 可能是首次信任

解决方法:
如果你信任这个服务器,并且确认这是正确的服务器,你可以选择忽略这个警告。在大多数情况下,只有第一次连接时会出现这个警告。
如果你想避免这个警告,可以手动将服务器的主机名和密钥添加到~/.ssh/known_hosts文件中。使用ssh-keyscan命令可以帮助你获取服务器的主机密钥:

ssh-keyscan github.com >> ~/.ssh/known_hosts

执行上述命令后,再次执行flutter pub get连接到github.com时,就不会看到这个警告信息了。

以下为解决的步骤截图:

image.png

相关文章

网友评论

      本文标题:Warning: Permanently added 'gith

      本文链接:https://www.haomeiwen.com/subject/anwkkjtx.html