简体   繁体   English

如何将已知指纹传给SSH(为了避免手动提示)

[英]How to pass a known fingerprint to SSH (in order to avoid the manual prompt)

How do I pass a known fingerprint (such as SHA256:BcOkb1S0zuj5A1CDxpOSuD2hnAArV1A3wKY7iOlks ) to SSH, so that I don't need to manually answer the prompt?如何将已知指纹(如SHA256:BcOkb1S0zuj5A1CDxpOSuD2hnAArV1A3wKY7iOlks )传递给 SSH,这样我就不需要手动回答提示了?

I tried the following, which does not seem to work:我尝试了以下方法,但似乎不起作用:

ssh some-user@my-domain.com <<EOF
SHA256:BcOkb1S0zuj5A1CDxpOSuD2hnAArV1A3wKY7iOlks
EOF

To add to the comment "You could prepare the complete entry and then copy it to the ~/.ssh/known_hosts file.", that preparation would be done using ssh-keyscan :要添加到评论“您可以准备完整的条目,然后将其复制到 ~/.ssh/known_hosts 文件。”,该准备将使用ssh-keyscan完成:

ssh-keyscan -H 192.168.1.162 
# or
ssh-keyscan my-domain.com

If you have a known fingerprint, you can also double-check it, if is still valid .如果您有已知的指纹,您也可以仔细检查它,如果仍然有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM