SSH 主机密钥:“ssh-keygen -H”与“ssh-keyscan”

SSH 主机密钥:“ssh-keygen -H”与“ssh-keyscan”

“ssh-keygen -F”似乎为给定的主机名返回一个主机密钥(第一个匹配?),“ssh-keyscan”似乎返回所有匹配,但顺序不清楚。

二者具体有什么区别?

答案1

来自ssh-keygen(1)手册页:

-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.

并从ssh-keyscan(1)联机帮助页中:

-H      Hash all hostnames and addresses in the output.  Hashed names may be used 
        normally by ssh and sshd, but they do not reveal identifying information should
        the file's contents be disclosed.

前朗姆酒本地,散列你的~/.ssh/known_hosts文件,而后者联系一个偏僻的服务器请求其密钥。

相关内容