- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
奇怪的问题..我怀疑 ssh-keyscan 中有一个错误,但也许我错了..
ssh-keyscan -H -t ecdsa host1,1.1.1.1 >> ~/.ssh/known_hosts
该命令将 howt1 的指纹提取到 known_hosts(主机名和 IP 显示正确散列),但是......但是当我使用主机名或 ip ssh 进入主机 1 时,系统提示我接受主机的公钥。因为我“已经”把它放在那里了,所以我认为这是一个错误。
编辑:我应该提一下,如果我不在 known_hosts 文件中散列主机名和 ip(没有“-H”选项的 ssh-keyscan),那么一切正常。 (-H在man ssh-keyscan中有记载)
有人知道怎么解决吗?还是出于某种奇怪的原因,这是它应该工作的方式?
是否可能是因为 known_hosts 中的条目在它的哈希值中同时包含两者,稍后当它比较名称或 IP 时,它在技术上不匹配,因为它不是“同时”比较的 ip 和主机名?
上次编辑:清理内容以使其更简单
提前致谢,
马克
最佳答案
如果您想将哈希条目添加到您的 known_hosts 文件中,您应该先对其进行哈希处理:
ssh-keygen -H
来自 ssh-keygen 的手册页:
-H Hash a known_hosts file. This replaces all hostnames and addresses with hashed representations within the specified file; the original content is moved to a file with a .old suffix. These hashes may be used normally by ssh and sshd, but they do not reveal identifying information should the file's contents be disclosed. This option will not modify existing hashed hostnames and is therefore safe to use on files that mix hashed and non- hashed names.
然后您可以像这样向您的 known_hosts 添加新条目:
ssh-keyscan -Ht ecdsa [hostname],[IP address] >> known_hosts
你应该完成了。
关于ssh 没有读取 .ssh/known_hosts 中的特定 ssh-keyscan 条目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18451833/
我正在运行 ssh-keyscan 来更新我的 known_hosts 文件: » ssh-keyscan -p 5634 -t ecdsa,dsa,rsa localhost >> .ssh/kno
我有一个简单的 Dockerfile,如下所示: FROM ubuntu:14.04 RUN apt-get update RUN apt-get -y upgrade RUN mkdir -p /r
为了成功地将私有(private)存储库克隆到基于 Alpine 的 docker 中,我需要运行以下命令: ssh-keyscan github.com >> ~/.ssh/known_hosts.
奇怪的问题..我怀疑 ssh-keyscan 中有一个错误,但也许我错了.. ssh-keyscan -H -t ecdsa host1,1.1.1.1 >> ~/.ssh/known_hosts 该
我是一名优秀的程序员,十分优秀!