diff options
Diffstat (limited to 'ssh-keyscan.0')
-rw-r--r-- | ssh-keyscan.0 | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/ssh-keyscan.0 b/ssh-keyscan.0 new file mode 100644 index 000000000..67dbc1152 --- /dev/null +++ b/ssh-keyscan.0 | |||
@@ -0,0 +1,103 @@ | |||
1 | SSH-KEYSCAN(1) OpenBSD Reference Manual SSH-KEYSCAN(1) | ||
2 | |||
3 | NAME | ||
4 | ssh-keyscan - gather ssh public keys | ||
5 | |||
6 | SYNOPSIS | ||
7 | ssh-keyscan [-v46] [-p port] [-T timeout] [-t type] [-f file] | ||
8 | [host | addrlist namelist] [...] | ||
9 | |||
10 | DESCRIPTION | ||
11 | ssh-keyscan is a utility for gathering the public ssh host keys of a num- | ||
12 | ber 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 pos- | ||
17 | sible 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 pro- | ||
21 | cess involve any encryption. | ||
22 | |||
23 | The options are as follows: | ||
24 | |||
25 | -p port | ||
26 | Port to connect to on the remote host. | ||
27 | |||
28 | -T timeout | ||
29 | Set the timeout for connection attempts. If timeout seconds have | ||
30 | elapsed since a connection was initiated to a host or since the | ||
31 | last time anything was read from that host, then the connection | ||
32 | is closed and the host in question considered unavailable. De- | ||
33 | fault is 5 seconds. | ||
34 | |||
35 | -t type | ||
36 | Specifies the type of the key to fetch from the scanned hosts. | ||
37 | The possible values are ``rsa1'' for protocol version 1 and | ||
38 | ``rsa'' or ``dsa'' for protocol version 2. Multiple values may | ||
39 | be specified by separating them with commas. The default is | ||
40 | ``rsa1''. | ||
41 | |||
42 | -f filename | ||
43 | Read hosts or addrlist namelist pairs from this file, one per | ||
44 | line. If - is supplied instead of a filename, ssh-keyscan will | ||
45 | read hosts or addrlist namelist pairs from the standard input. | ||
46 | |||
47 | -v Verbose mode. Causes ssh-keyscan to print debugging messages | ||
48 | about its progress. | ||
49 | |||
50 | -4 Forces ssh-keyscan to use IPv4 addresses only. | ||
51 | |||
52 | -6 Forces ssh-keyscan to use IPv6 addresses only. | ||
53 | |||
54 | SECURITY | ||
55 | If a ssh_known_hosts file is constructed using ssh-keyscan without veri- | ||
56 | fying the keys, users will be vulnerable to attacks. On the other hand, | ||
57 | if the security model allows such a risk, ssh-keyscan can help in the de- | ||
58 | tection of tampered keyfiles or man in the middle attacks which have be- | ||
59 | gun after the ssh_known_hosts file was created. | ||
60 | |||
61 | FILES | ||
62 | Input format: | ||
63 | |||
64 | 1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4 | ||
65 | |||
66 | Output format for rsa1 keys: | ||
67 | |||
68 | host-or-namelist bits exponent modulus | ||
69 | |||
70 | Output format for rsa and dsa keys: | ||
71 | |||
72 | host-or-namelist keytype base64-encoded-key | ||
73 | |||
74 | Where keytype is either ``ssh-rsa'' or ``ssh-dss''. | ||
75 | |||
76 | /etc/ssh/ssh_known_hosts | ||
77 | |||
78 | EXAMPLES | ||
79 | Print the rsa1 host key for machine hostname: | ||
80 | |||
81 | $ ssh-keyscan hostname | ||
82 | |||
83 | Find all hosts from the file ssh_hosts which have new or different keys | ||
84 | from those in the sorted file ssh_known_hosts: | ||
85 | |||
86 | $ ssh-keyscan -t rsa,dsa -f ssh_hosts | \ | ||
87 | sort -u - ssh_known_hosts | diff ssh_known_hosts - | ||
88 | |||
89 | SEE ALSO | ||
90 | ssh(1), sshd(8) | ||
91 | |||
92 | AUTHORS | ||
93 | David Mazieres <dm@lcs.mit.edu> wrote the initial version, and | ||
94 | Wayne Davison <wayned@users.sourceforge.net> added support for protocol | ||
95 | version 2. | ||
96 | |||
97 | BUGS | ||
98 | It generates "Connection closed by remote host" messages on the consoles | ||
99 | of all the machines it scans if the server is older than version 2.9. | ||
100 | This is because it opens a connection to the ssh port, reads the public | ||
101 | key, and drops the connection as soon as it gets the key. | ||
102 | |||
103 | OpenBSD 3.4 January 1, 1996 2 | ||