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 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教