📄 ssh-keyscan.1
字号:
.\" $OpenBSD: ssh-keyscan.1,v 1.15 2003/03/28 10:11:43 jmc Exp $.\".\" Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>..\".\" Modification and redistribution in source and binary forms is.\" permitted provided that due credit is given to the author and the.\" OpenBSD project by leaving this copyright notice intact..\".Dd January 1, 1996.Dt SSH-KEYSCAN 1.Os.Sh NAME.Nm ssh-keyscan.Nd gather ssh public keys.Sh SYNOPSIS.Nm ssh-keyscan.Bk -words.Op Fl v46.Op Fl p Ar port.Op Fl T Ar timeout.Op Fl t Ar type.Op Fl f Ar file.Op Ar host | addrlist namelist.Op Ar ....Ek.Sh DESCRIPTION.Nmis a utility for gathering the public ssh host keys of a number ofhosts.It was designed to aid in building and verifying.Pa ssh_known_hostsfiles..Nmprovides a minimal interface suitable for use by shell and perlscripts..Pp.Nmuses non-blocking socket I/O to contact as many hosts as possible inparallel, so it is very efficient.The keys from a domain of 1,000hosts can be collected in tens of seconds, even when some of thosehosts are down or do not run ssh.For scanning, one does not needlogin access to the machines that are being scanned, nor does thescanning process involve any encryption..PpThe options are as follows:.Bl -tag -width Ds.It Fl p Ar portPort to connect to on the remote host..It Fl T Ar timeoutSet the timeout for connection attempts.If.Pa timeoutseconds have elapsed since a connection was initiated to a host or since thelast time anything was read from that host, then the connection isclosed and the host in question considered unavailable.Default is 5 seconds..It Fl t Ar typeSpecifies the type of the key to fetch from the scanned hosts.The possible values are.Dq rsa1for protocol version 1 and.Dq rsaor.Dq dsafor protocol version 2.Multiple values may be specified by separating them with commas.The default is.Dq rsa1 ..It Fl f Ar filenameRead hosts or.Pa addrlist namelistpairs from this file, one per line.If.Pa -is supplied instead of a filename,.Nmwill read hosts or.Pa addrlist namelistpairs from the standard input..It Fl vVerbose mode.Causes.Nmto print debugging messages about its progress..It Fl 4Forces.Nmto use IPv4 addresses only..It Fl 6Forces.Nmto use IPv6 addresses only..El.Sh SECURITYIf a ssh_known_hosts file is constructed using.Nmwithout verifying the keys, users will be vulnerable to.I man in the middleattacks.On the other hand, if the security model allows such a risk,.Nmcan help in the detection of tampered keyfiles or man in the middleattacks which have begun after the ssh_known_hosts file was created..Sh EXAMPLES.PpPrint the.Pa rsa1host key for machine.Pa hostname :.Bd -literal$ ssh-keyscan hostname.Ed.PpFind all hosts from the file.Pa ssh_hostswhich have new or different keys from those in the sorted file.Pa ssh_known_hosts :.Bd -literal$ ssh-keyscan -t rsa,dsa -f ssh_hosts | \e\ sort -u - ssh_known_hosts | diff ssh_known_hosts -.Ed.Sh FILES.Pa Input format:.Bd -literal1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4.Ed.Pp.Pa Output format for rsa1 keys:.Bd -literalhost-or-namelist bits exponent modulus.Ed.Pp.Pa Output format for rsa and dsa keys:.Bd -literalhost-or-namelist keytype base64-encoded-key.Ed.PpWhere.Pa keytypeis either.Dq ssh-rsaor.Dq ssh-dsa ..Pp.Pa /etc/ssh/ssh_known_hosts.Sh BUGSIt generates "Connection closed by remote host" messages on the consolesof all the machines it scans if the server is older than version 2.9.This is because it opens a connection to the ssh port, reads the publickey, and drops the connection as soon as it gets the key..Sh SEE ALSO.Xr ssh 1 ,.Xr sshd 8.Sh AUTHORSDavid Mazieres <dm@lcs.mit.edu>wrote the initial version, andWayne Davison <wayned@users.sourceforge.net>added support for protocol version 2.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -