设置go test
以更新export GO111MODULE=on
并运行测试套件后,我正在使用go.mod
命令。
我看到了很多像下面这样的身份验证错误
The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? go: modernc.org/cc@v1.0.0: unknown revision v1.0.0
go: modernc.org/mathutil@v1.0.0: unknown revision v1.0.0
The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? go: modernc.org/strutil@v1.0.0: unknown revision v1.0.0
go: modernc.org/golex@v1.0.0: unknown revision v1.0.0
go版本为go1.12.1 linux/amd64
答案 0 :(得分:0)
当不知道主机密钥时,这是正常的SSH行为。 go工具不会显示要求您接受(或拒绝)主机密钥的提示。
您可以通过运行以下命令自己添加它们:
# Fetch keys for gitlab.com, save them to a temporary file.
$ ssh-keyscan -H gitlab.com > tmpkeys
# Print the checksums
$ ssh-keygen -l -f tmpkeys
2048 SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ |1|acl3SWCVoYBF6aZrd2FSWIafzT8=|fu8Ivfg6HIGVxsFSx5u3aZwY6CQ= (RSA)
256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw |1|LMWC/o9XJxW3EtS0hN8/WBBkPrk=|JocpRioPZiOte6ek33XOO6JljQY= (ECDSA)
256 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8 |1|BAhrVESJhSsdsGsXHXzY1bvW3P0=|p4KuzvnpUqZA/PGKGkjN0sXKsuk= (ED25519)
# If satisfied with the checksums, append the keys to the known hosts file.
$ cat tmpkeys >> ~/.ssh/known_hosts
可以在gitlab's site上验证主机密钥校验和。
完成此操作后:再次尝试执行该命令,它将停止提示您输入主机密钥,因为它们将是已知的。