]> andersk Git - openssh.git/blame - ssh-keyscan.1
20010115
[openssh.git] / ssh-keyscan.1
CommitLineData
f6fdbddf 1.Dd January 1, 1996
2.Dt ssh-keyscan 1
3.Os
4.Sh NAME
5.Nm ssh-keyscan
6.Nd gather ssh public keys
7.Sh SYNOPSIS
8.Nm ssh-keyscan
9.Op Fl t Ar timeout
10.Op Ar -- | host | addrlist namelist
11.Op Fl f Ar files ...
12.Sh DESCRIPTION
13.Nm
14is a utility for gathering the public ssh host keys of a number of
15hosts. It was designed to aid in building and verifying
16.Pa ssh_known_hosts
17files.
18.Nm
19provides a minimal interface suitable for use by shell and perl
20scripts.
21.Pp
22.Nm
23uses non-blocking socket I/O to contact as many hosts as possible in
24parallel, so it is very efficient. The keys from a domain of 1,000
25hosts can be collected in tens of seconds, even when some of those
26hosts are down or do not run ssh. You do not need login access to the
27machines you are scanning, nor does does the scanning process involve
28any encryption.
29.Sh SECURITY
30If you make an ssh_known_hosts file using
31.Nm
32without verifying the keys, you will be vulnerable to
33.I man in the middle
34attacks.
35On the other hand, if your security model allows such a risk,
36.Nm
37can help you detect tampered keyfiles or man in the middle attacks which
38have begun after you created your ssh_known_hosts file.
39.Sh OPTIONS
40.Bl -tag -width Ds
41.It Fl t
42Set the timeout for connection attempts. If
43.Pa timeout
44seconds have elapsed since a connection was initiated to a host or since the
45last time anything was read from that host, then the connection is
46closed and the host in question considered unavailable. Default is 5
47seconds.
48.It Fl f
49Read hosts or
50.Pa addrlist namelist
51pairs from this file, one per line.
52If
53.Pa -
54is supplied instead of a filename,
55.Nm
56will read hosts or
57.Pa addrlist namelist
58pairs from the standard input.
9616313f 59.El
f6fdbddf 60.Sh EXAMPLES
61.Pp
62Print the host key for machine
63.Pa hostname :
64.Bd -literal
65ssh-keyscan hostname
66.Ed
67.Pp
68Find all hosts from the file
69.Pa ssh_hosts
70which have new or different keys from those in the sorted file
71.Pa ssh_known_hosts :
72.Bd -literal
73ssh-keyscan -f ssh_hosts | sort -u - ssh_known_hosts | \e\
74 diff ssh_known_hosts -
75.Ed
76.Pp
77.Sh FILES
78.Pp
79.Pa Input format:
801.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4
81.Pp
82.Pa Output format:
83host-or-namelist bits exponent modulus
84.Pp
85.Pa /etc/ssh_known_hosts
86.Sh BUGS
87It generates "Connection closed by remote host" messages on the consoles
88of all the machines it scans.
89This is because it opens a connection to the ssh port, reads the public
90key, and drops the connection as soon as it gets the key.
91.Sh SEE ALSO
92.Xr ssh 1
93.Xr sshd 8
94.Sh AUTHOR
95David Mazieres <dm@lcs.mit.edu>
This page took 0.060869 seconds and 5 git commands to generate.