Penguin
Blame: ssh-keyscan(1)
EditPageHistoryDiffInfoLikePages
Annotated edit history of ssh-keyscan(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 ----
2 __NAME__
3
4
5 ssh-keyscan - gather ssh public keys
6 __SYNOPSIS__
7
8
9 ssh-keyscan [[-v46] [[-p port] [[-T timeout] [[-t type] [[-f
10 file] [[host | addrlist namelist] [[...]
11 __DESCRIPTION__
12
13
14 ssh-keyscan is a utility for gathering the public ssh host
15 keys of a number of hosts. It was designed to aid in build-
16 ing and verifying ssh_known_hosts files.
17 ssh-keyscan pro- vides a minimal interface suitable for use
18 by shell and perl scripts.
19
20
21 ssh-keyscan uses non-blocking socket I/O to contact as many hosts as possible in parallel, so it is very efficient. The keys from a domain of 1,000 hosts can be collected in tens of seconds, even when some of those hosts are down or do not run ssh. For scanning, one does not need login access to the machines that are being scanned, nor does the scanning process involve any encryption.
22
23
24 The options are as follows:
25 -p port
26
27
28 Port to connect to on the remote host.-T timeoutSet 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.
29
30
31 -t type
32 Specifies the type of the key to fetch from the scanned
33 hosts. The possible values are ``rsa1'' for protocol version
34 1 and ``rsa'' or ``dsa'' for proto- col version 2. Multiple
35 values may be specified by separating them with commas. The
36 default is ``rsa1''.
37
38
39 -f filename
40 Read hosts or addrlist namelist pairs from this
41 file, one per line. If - is supplied instead of a
42 file- name, ssh-keyscan will read hosts or addrlist
43 namelist pairs from the standard input.
44
45
46 -v
47 Verbose mode. Causes ssh-keyscan to print debugging messages
48 about its progress.
49
50
51 -4
52 Forces ssh-keyscan to use IPv4 addresses only.
53
54
55 -6
56 Forces ssh-keyscan to use IPv6 addresses only.
57
58
59 __SECURITY__
60
61
62 If a ssh_known_hosts file is constructed using ssh-keyscan
63 without verifying the keys, users will be vulnerable to
64 attacks. On the other hand, if the security model allows
65 such a risk, ssh-keyscan can help in the detection of tam-
66 pered keyfiles or man in the middle attacks which have begun
67 after the ssh_known_hosts file was created.
68 __EXAMPLES__
69
70
71 Print the rsa1 host key for machine hostname:
72
73
74 ssh-keyscan hostname
75 Find all hosts from the file ssh_hosts which have new or different keys from those in the sorted file ssh_known_hosts:
76
77
78 ssh-keyscan -t rsa,dsa -f ssh_hosts | \
79 sort -u - ssh_known_hosts | diff ssh_known_hosts -
80 __FILES__
81
82
83 Input format:
84
85
86 1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4
87 Output format for rsa1 keys:
88
89
90 host-or-namelist bits exponent modulus
91 Output format for rsa and dsa keys:
92
93
94 host-or-namelist keytype base64-encoded-key
95 Where keytype is either ``ssh-rsa'' or ``ssh-dsa''.
96
97
98 /etc/ssh/ssh_known_hosts
99 __BUGS__
100
101
102 It generates
103 __SEE ALSO__
104
105
106 ssh(1), sshd(8)
107 __AUTHORS__
108
109
110 David Mazieres
111
112
113 BSD January 1, 1996 1
114 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.