summaryrefslogtreecommitdiff
path: root/ssh-keyscan.0
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.0')
-rw-r--r--ssh-keyscan.096
1 files changed, 96 insertions, 0 deletions
diff --git a/ssh-keyscan.0 b/ssh-keyscan.0
new file mode 100644
index 000000000..02475f9a3
--- /dev/null
+++ b/ssh-keyscan.0
@@ -0,0 +1,96 @@
1SSH-KEYSCAN(1) General Commands Manual SSH-KEYSCAN(1)
2
3NAME
4 ssh-keyscan M-bM-^@M-^S gather SSH public keys
5
6SYNOPSIS
7 ssh-keyscan [-46cDHv] [-f file] [-p port] [-T timeout] [-t type]
8 [host | addrlist namelist]
9
10DESCRIPTION
11 ssh-keyscan is a utility for gathering the public SSH host keys of a
12 number of hosts. It was designed to aid in building and verifying
13 ssh_known_hosts files, the format of which is documented in sshd(8).
14 ssh-keyscan provides a minimal interface suitable for use by shell and
15 perl scripts.
16
17 ssh-keyscan uses non-blocking socket I/O to contact as many hosts as
18 possible in parallel, so it is very efficient. The keys from a domain of
19 1,000 hosts can be collected in tens of seconds, even when some of those
20 hosts are down or do not run sshd(8). For scanning, one does not need
21 login access to the machines that are being scanned, nor does the
22 scanning process involve any encryption.
23
24 The options are as follows:
25
26 -4 Force ssh-keyscan to use IPv4 addresses only.
27
28 -6 Force ssh-keyscan to use IPv6 addresses only.
29
30 -c Request certificates from target hosts instead of plain keys.
31
32 -D Print keys found as SSHFP DNS records. The default is to print
33 keys in a format usable as a ssh(1) known_hosts file.
34
35 -f file
36 Read hosts or M-bM-^@M-^\addrlist namelistM-bM-^@M-^] pairs from file, one per line.
37 If M-bM-^@M-^X-M-bM-^@M-^Y is supplied instead of a filename, ssh-keyscan will read
38 from the standard input. Input is expected in the format:
39
40 1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4
41
42 -H Hash all hostnames and addresses in the output. Hashed names may
43 be used normally by ssh(1) and sshd(8), but they do not reveal
44 identifying information should the file's contents be disclosed.
45
46 -p port
47 Connect to port on the remote host.
48
49 -T timeout
50 Set the timeout for connection attempts. If timeout seconds have
51 elapsed since a connection was initiated to a host or since the
52 last time anything was read from that host, the connection is
53 closed and the host in question considered unavailable. The
54 default is 5 seconds.
55
56 -t type
57 Specify the type of the key to fetch from the scanned hosts. The
58 possible values are M-bM-^@M-^\dsaM-bM-^@M-^], M-bM-^@M-^\ecdsaM-bM-^@M-^], M-bM-^@M-^\ed25519M-bM-^@M-^], or M-bM-^@M-^\rsaM-bM-^@M-^].
59 Multiple values may be specified by separating them with commas.
60 The default is to fetch M-bM-^@M-^\rsaM-bM-^@M-^], M-bM-^@M-^\ecdsaM-bM-^@M-^], and M-bM-^@M-^\ed25519M-bM-^@M-^] keys.
61
62 -v Verbose mode: print debugging messages about progress.
63
64 If an ssh_known_hosts file is constructed using ssh-keyscan without
65 verifying the keys, users will be vulnerable to man in the middle
66 attacks. On the other hand, if the security model allows such a risk,
67 ssh-keyscan can help in the detection of tampered keyfiles or man in the
68 middle attacks which have begun after the ssh_known_hosts file was
69 created.
70
71FILES
72 /etc/ssh/ssh_known_hosts
73
74EXAMPLES
75 Print the RSA host key for machine hostname:
76
77 $ ssh-keyscan -t rsa hostname
78
79 Find all hosts from the file ssh_hosts which have new or different keys
80 from those in the sorted file ssh_known_hosts:
81
82 $ ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f ssh_hosts | \
83 sort -u - ssh_known_hosts | diff ssh_known_hosts -
84
85SEE ALSO
86 ssh(1), sshd(8)
87
88 Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints, RFC
89 4255, 2006.
90
91AUTHORS
92 David Mazieres <dm@lcs.mit.edu> wrote the initial version, and Wayne
93 Davison <wayned@users.sourceforge.net> added support for protocol version
94 2.
95
96OpenBSD 6.6 March 5, 2018 OpenBSD 6.6