summaryrefslogtreecommitdiff
path: root/ssh-keyscan.0
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.0')
-rw-r--r--ssh-keyscan.0111
1 files changed, 111 insertions, 0 deletions
diff --git a/ssh-keyscan.0 b/ssh-keyscan.0
new file mode 100644
index 000000000..853bd5152
--- /dev/null
+++ b/ssh-keyscan.0
@@ -0,0 +1,111 @@
1SSH-KEYSCAN(1) General Commands Manual SSH-KEYSCAN(1)
2
3NAME
4 ssh-keyscan - gather ssh public keys
5
6SYNOPSIS
7 ssh-keyscan [-46Hv] [-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. ssh-keyscan provides a minimal interface suitable
14 for use by shell and perl scripts.
15
16 ssh-keyscan uses non-blocking socket I/O to contact as many hosts as
17 possible in parallel, so it is very efficient. The keys from a domain of
18 1,000 hosts can be collected in tens of seconds, even when some of those
19 hosts are down or do not run ssh. For scanning, one does not need login
20 access to the machines that are being scanned, nor does the scanning
21 process involve any encryption.
22
23 The options are as follows:
24
25 -4 Forces ssh-keyscan to use IPv4 addresses only.
26
27 -6 Forces ssh-keyscan to use IPv6 addresses only.
28
29 -f file
30 Read hosts or ``addrlist namelist'' pairs from file, one per
31 line. If - is supplied instead of a filename, ssh-keyscan will
32 read hosts or ``addrlist namelist'' pairs from the standard
33 input.
34
35 -H Hash all hostnames and addresses in the output. Hashed names may
36 be used normally by ssh and sshd, but they do not reveal
37 identifying information should the file's contents be disclosed.
38
39 -p port
40 Port to connect to on the remote host.
41
42 -T timeout
43 Set the timeout for connection attempts. If timeout seconds have
44 elapsed since a connection was initiated to a host or since the
45 last time anything was read from that host, then the connection
46 is closed and the host in question considered unavailable.
47 Default is 5 seconds.
48
49 -t type
50 Specifies the type of the key to fetch from the scanned hosts.
51 The possible values are ``rsa1'' for protocol version 1 and
52 ``dsa'', ``ecdsa'', ``ed25519'', or ``rsa'' for protocol version
53 2. Multiple values may be specified by separating them with
54 commas. The default is to fetch ``rsa'', ``ecdsa'', and
55 ``ed25519'' keys.
56
57 -v Verbose mode. Causes ssh-keyscan to print debugging messages
58 about its progress.
59
60SECURITY
61 If an ssh_known_hosts file is constructed using ssh-keyscan without
62 verifying the keys, users will be vulnerable to man in the middle
63 attacks. On the other hand, if the security model allows such a risk,
64 ssh-keyscan can help in the detection of tampered keyfiles or man in the
65 middle attacks which have begun after the ssh_known_hosts file was
66 created.
67
68FILES
69 Input format:
70
71 1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4
72
73 Output format for RSA1 keys:
74
75 host-or-namelist bits exponent modulus
76
77 Output format for RSA, DSA, ECDSA, and ED25519 keys:
78
79 host-or-namelist keytype base64-encoded-key
80
81 Where keytype is either ``ecdsa-sha2-nistp256'', ``ecdsa-sha2-nistp384'',
82 ``ecdsa-sha2-nistp521'', ``ssh-ed25519'', ``ssh-dss'' or ``ssh-rsa''.
83
84 /etc/ssh/ssh_known_hosts
85
86EXAMPLES
87 Print the rsa host key for machine hostname:
88
89 $ ssh-keyscan hostname
90
91 Find all hosts from the file ssh_hosts which have new or different keys
92 from those in the sorted file ssh_known_hosts:
93
94 $ ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f ssh_hosts | \
95 sort -u - ssh_known_hosts | diff ssh_known_hosts -
96
97SEE ALSO
98 ssh(1), sshd(8)
99
100AUTHORS
101 David Mazieres <dm@lcs.mit.edu> wrote the initial version, and Wayne
102 Davison <wayned@users.sourceforge.net> added support for protocol version
103 2.
104
105BUGS
106 It generates "Connection closed by remote host" messages on the consoles
107 of all the machines it scans if the server is older than version 2.9.
108 This is because it opens a connection to the ssh port, reads the public
109 key, and drops the connection as soon as it gets the key.
110
111OpenBSD 5.6 March 12, 2014 OpenBSD 5.6