Manage the information stored in the known_hosts files.
github.com: ssh_known_hosts: - present - user: root - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 example.com: ssh_known_hosts: - absent - user: root
absent(name, user=None, config=None)¶
Verifies that the specified host is not known by the given user
present(name, user=None, fingerprint=None, key=None, port=None, enc=None, config=None, hash_hostname=True, hash_known_hosts=True, timeout=5)¶
Verifies that the specified host is known by the specified user
On many systems, specifically those running with openssh 4 or older, the
enc option must be set, only openssh 5 and above can detect the key
Hash all hostnames and addresses in the known hosts file.
Carbon 版后已移除: Please use hash_known_hosts instead.
Set the timeout for connection attempts. If
timeout seconds have
elapsed since a connection was initiated to a host or since the last
time anything was read from that host, then the connection is closed
and the host in question considered unavailable. Default is 5 seconds.