所以我正在设置 GitLab,但在此过程中遇到了一个问题。即,https://docs.gitlab.com/ee/user/gitlab_com/index.html#ssh-host-keys-fingerprints此链接要求将条目添加到known_hosts. 然而,问题是,当我尝试运行这样的命令时,/.ssh$ .ssh/known_hosts gitlab.com ssh-ed25519 ...我收到此错误。
我刚刚从头开始设置了这个 ssh 东西。
显然我一开始就没有那个文件。有办法创建它吗?
ssh它将在您第一次致电时为您创建
ssh -T git@gitlab.com
Run Code Online (Sandbox Code Playgroud)
我将触发如下消息:
ssh -T git@gitlab.com
Run Code Online (Sandbox Code Playgroud)
回答“是”将创建~/.ssh/known_hosts
正如切普纳在评论中所说,您应该在回答“是”之前提前获取服务器的实际指纹,并将该指纹与添加到~/.ssh/known_hosts.
例如,请参阅“将主机(例如 GitHub)安全地添加到 SSHknown_hosts 文件”。
例如:确实github.com给出了它的服务器指纹:将其与 ssh-keyscan -t rsa github.com | ssh-keygen -lf -.
The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established.
RSA key fingerprint is f1:cf:58:ae:71:0b:c8:04:6f:34:a6:b2:e4:1e:0c:8b.
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud)
如果匹配,则将其添加到您的~/.ssh/known_hosts.
| 归档时间: |
|
| 查看次数: |
49246 次 |
| 最近记录: |