douhanzhuo6905 2019-05-25 00:59 采纳率: 100%
浏览 169
已采纳

使用Go测试时出现身份验证错误

I am using go test command after setting export GO111MODULE=on to update go.mod and run a test suite.

I see so many authentication errors like below

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 version is go1.12.1 linux/amd64

  • 写回答

1条回答 默认 最新

  • douxing6532 2019-05-25 05:38
    关注

    This is normal SSH behavior when it does not know the host keys. The go tooling does not surface the prompt asking you to accept (or reject) the host keys.

    You can add them yourself by running:

    # 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 
    

    The host key checksums can be verified on gitlab's site.

    Once you've done this: try the command again, it should stop prompting you for host keys as they will be known.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题