summaryrefslogtreecommitdiff
path: root/sshd.8
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2006-05-12 08:53:37 +0000
committerColin Watson <cjwatson@debian.org>2006-05-12 08:53:37 +0000
commit2ee73b36b9a35daeaa4b065046882dc1f5f551b6 (patch)
treef64a4ace625514e94759878c0b94ab0a79805bbd /sshd.8
parent3c190ec8e469477ea65fbf4cc83062c65c281434 (diff)
parent3e2e0ac10674d77618c4c7339e18b83ced247492 (diff)
Merge 4.3p2 to the trunk.
Diffstat (limited to 'sshd.8')
-rw-r--r--sshd.8255
1 files changed, 129 insertions, 126 deletions
diff --git a/sshd.8 b/sshd.8
index 92eb7a9da..fec3c3582 100644
--- a/sshd.8
+++ b/sshd.8
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: sshd.8,v 1.208 2005/06/08 03:50:00 djm Exp $ 37.\" $OpenBSD: sshd.8,v 1.215 2006/02/01 09:11:41 jmc Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSHD 8 39.Dt SSHD 8
40.Os 40.Os
@@ -56,16 +56,14 @@
56.Ek 56.Ek
57.Sh DESCRIPTION 57.Sh DESCRIPTION
58.Nm 58.Nm
59(SSH Daemon) is the daemon program for 59(OpenSSH Daemon) is the daemon program for
60.Xr ssh 1 . 60.Xr ssh 1 .
61Together these programs replace rlogin and rsh, and 61Together these programs replace rlogin and rsh, and
62provide secure encrypted communications between two untrusted hosts 62provide secure encrypted communications between two untrusted hosts
63over an insecure network. 63over an insecure network.
64The programs are intended to be as easy to
65install and use as possible.
66.Pp 64.Pp
67.Nm 65.Nm
68is the daemon that listens for connections from clients. 66listens for connections from clients.
69It is normally started at boot from 67It is normally started at boot from
70.Pa /etc/rc . 68.Pa /etc/rc .
71It forks a new 69It forks a new
@@ -73,119 +71,13 @@ daemon for each incoming connection.
73The forked daemons handle 71The forked daemons handle
74key exchange, encryption, authentication, command execution, 72key exchange, encryption, authentication, command execution,
75and data exchange. 73and data exchange.
76This implementation of
77.Nm
78supports both SSH protocol version 1 and 2 simultaneously.
79.Nm
80works as follows:
81.Ss SSH protocol version 1
82Each host has a host-specific RSA key
83(normally 2048 bits) used to identify the host.
84Additionally, when
85the daemon starts, it generates a server RSA key (normally 768 bits).
86This key is normally regenerated every hour if it has been used, and
87is never stored on disk.
88.Pp
89Whenever a client connects, the daemon responds with its public
90host and server keys.
91The client compares the
92RSA host key against its own database to verify that it has not changed.
93The client then generates a 256-bit random number.
94It encrypts this
95random number using both the host key and the server key, and sends
96the encrypted number to the server.
97Both sides then use this
98random number as a session key which is used to encrypt all further
99communications in the session.
100The rest of the session is encrypted
101using a conventional cipher, currently Blowfish or 3DES, with 3DES
102being used by default.
103The client selects the encryption algorithm
104to use from those offered by the server.
105.Pp
106Next, the server and the client enter an authentication dialog.
107The client tries to authenticate itself using
108.Em .rhosts
109authentication combined with RSA host
110authentication, RSA challenge-response authentication, or password
111based authentication.
112.Pp
113Regardless of the authentication type, the account is checked to
114ensure that it is accessible. An account is not accessible if it is
115locked, listed in
116.Cm DenyUsers
117or its group is listed in
118.Cm DenyGroups
119\&. The definition of a locked account is system dependant. Some platforms
120have their own account database (eg AIX) and some modify the passwd field (
121.Ql \&*LK\&*
122on Solaris,
123.Ql \&*
124on HP-UX, containing
125.Ql Nologin
126on Tru64 and a leading
127.Ql \&!!
128on Linux). If there is a requirement to disable password authentication
129for the account while allowing still public-key, then the passwd field
130should be set to something other than these values (eg
131.Ql NP
132or
133.Ql \&*NP\&*
134).
135.Pp
136.Nm rshd ,
137.Nm rlogind ,
138and
139.Nm rexecd
140are disabled (thus completely disabling
141.Xr rlogin
142and
143.Xr rsh
144into the machine).
145.Ss SSH protocol version 2
146Version 2 works similarly:
147Each host has a host-specific key (RSA or DSA) used to identify the host.
148However, when the daemon starts, it does not generate a server key.
149Forward security is provided through a Diffie-Hellman key agreement.
150This key agreement results in a shared session key.
151.Pp
152The rest of the session is encrypted using a symmetric cipher, currently
153128-bit AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES.
154The client selects the encryption algorithm
155to use from those offered by the server.
156Additionally, session integrity is provided
157through a cryptographic message authentication code
158(hmac-sha1 or hmac-md5).
159.Pp
160Protocol version 2 provides a public key based
161user (PubkeyAuthentication) or
162client host (HostbasedAuthentication) authentication method,
163conventional password authentication and challenge response based methods.
164.Ss Command execution and data forwarding
165If the client successfully authenticates itself, a dialog for
166preparing the session is entered.
167At this time the client may request
168things like allocating a pseudo-tty, forwarding X11 connections,
169forwarding TCP/IP connections, or forwarding the authentication agent
170connection over the secure channel.
171.Pp
172Finally, the client either requests a shell or execution of a command.
173The sides then enter session mode.
174In this mode, either side may send
175data at any time, and such data is forwarded to/from the shell or
176command on the server side, and the user terminal in the client side.
177.Pp
178When the user program terminates and all forwarded X11 and other
179connections have been closed, the server sends command exit status to
180the client, and both sides exit.
181.Pp 74.Pp
182.Nm 75.Nm
183can be configured using command-line options or a configuration file 76can be configured using command-line options or a configuration file
184(by default 77(by default
185.Xr sshd_config 5 ) . 78.Xr sshd_config 5 ) ;
186Command-line options override values specified in the 79command-line options override values specified in the
187configuration file. 80configuration file.
188.Pp
189.Nm 81.Nm
190rereads its configuration file when it receives a hangup signal, 82rereads its configuration file when it receives a hangup signal,
191.Dv SIGHUP , 83.Dv SIGHUP ,
@@ -285,8 +177,12 @@ For full details of the options, and their values, see
285Specifies the port on which the server listens for connections 177Specifies the port on which the server listens for connections
286(default 22). 178(default 22).
287Multiple port options are permitted. 179Multiple port options are permitted.
288Ports specified in the configuration file are ignored when a 180Ports specified in the configuration file with the
289command-line port is specified. 181.Cm Port
182option are ignored when a command-line port is specified.
183Ports specified using the
184.Cm ListenAddress
185option override command-line ports.
290.It Fl q 186.It Fl q
291Quiet mode. 187Quiet mode.
292Only fatal errors are sent to the system log. 188Only fatal errors are sent to the system log.
@@ -324,7 +220,7 @@ from making DNS requests unless the authentication
324mechanism or configuration requires it. 220mechanism or configuration requires it.
325Authentication mechanisms that may require DNS include 221Authentication mechanisms that may require DNS include
326.Cm RhostsRSAAuthentication , 222.Cm RhostsRSAAuthentication ,
327.Cm HostbasedAuthentication 223.Cm HostbasedAuthentication ,
328and using a 224and using a
329.Cm from="pattern-list" 225.Cm from="pattern-list"
330option in a key file. 226option in a key file.
@@ -334,15 +230,114 @@ USER@HOST pattern in
334or 230or
335.Cm DenyUsers . 231.Cm DenyUsers .
336.El 232.El
337.Sh CONFIGURATION FILE 233.Sh AUTHENTICATION
338.Nm 234The OpenSSH SSH daemon supports SSH protocols 1 and 2.
339reads configuration data from 235Both protocols are supported by default,
340.Pa /etc/ssh/sshd_config 236though this can be changed via the
341(or the file specified with 237.Cm Protocol
342.Fl f 238option in
343on the command line).
344The file format and configuration options are described in
345.Xr sshd_config 5 . 239.Xr sshd_config 5 .
240Protocol 2 supports both RSA and DSA keys;
241protocol 1 only supports RSA keys.
242For both protocols,
243each host has a host-specific key,
244normally 2048 bits,
245used to identify the host.
246.Pp
247Forward security for protocol 1 is provided through
248an additional server key,
249normally 768 bits,
250generated when the server starts.
251This key is normally regenerated every hour if it has been used, and
252is never stored on disk.
253Whenever a client connects, the daemon responds with its public
254host and server keys.
255The client compares the
256RSA host key against its own database to verify that it has not changed.
257The client then generates a 256-bit random number.
258It encrypts this
259random number using both the host key and the server key, and sends
260the encrypted number to the server.
261Both sides then use this
262random number as a session key which is used to encrypt all further
263communications in the session.
264The rest of the session is encrypted
265using a conventional cipher, currently Blowfish or 3DES, with 3DES
266being used by default.
267The client selects the encryption algorithm
268to use from those offered by the server.
269.Pp
270For protocol 2,
271forward security is provided through a Diffie-Hellman key agreement.
272This key agreement results in a shared session key.
273The rest of the session is encrypted using a symmetric cipher, currently
274128-bit AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES.
275The client selects the encryption algorithm
276to use from those offered by the server.
277Additionally, session integrity is provided
278through a cryptographic message authentication code
279(hmac-sha1 or hmac-md5).
280.Pp
281Finally, the server and the client enter an authentication dialog.
282The client tries to authenticate itself using
283host-based authentication,
284public key authentication,
285challenge-response authentication,
286or password authentication.
287.Pp
288Regardless of the authentication type, the account is checked to
289ensure that it is accessible. An account is not accessible if it is
290locked, listed in
291.Cm DenyUsers
292or its group is listed in
293.Cm DenyGroups
294\&. The definition of a locked account is system dependant. Some platforms
295have their own account database (eg AIX) and some modify the passwd field (
296.Ql \&*LK\&*
297on Solaris and UnixWare,
298.Ql \&*
299on HP-UX, containing
300.Ql Nologin
301on Tru64,
302a leading
303.Ql \&*LOCKED\&*
304on FreeBSD and a leading
305.Ql \&!!
306on Linux). If there is a requirement to disable password authentication
307for the account while allowing still public-key, then the passwd field
308should be set to something other than these values (eg
309.Ql NP
310or
311.Ql \&*NP\&*
312).
313.Pp
314System security is not improved unless
315.Nm rshd ,
316.Nm rlogind ,
317and
318.Nm rexecd
319are disabled (thus completely disabling
320.Xr rlogin
321and
322.Xr rsh
323into the machine).
324.Sh COMMAND EXECUTION AND DATA FORWARDING
325If the client successfully authenticates itself, a dialog for
326preparing the session is entered.
327At this time the client may request
328things like allocating a pseudo-tty, forwarding X11 connections,
329forwarding TCP connections, or forwarding the authentication agent
330connection over the secure channel.
331.Pp
332Finally, the client either requests a shell or execution of a command.
333The sides then enter session mode.
334In this mode, either side may send
335data at any time, and such data is forwarded to/from the shell or
336command on the server side, and the user terminal in the client side.
337.Pp
338When the user program terminates and all forwarded X11 and other
339connections have been closed, the server sends command exit status to
340the client, and both sides exit.
346.Sh LOGIN PROCESS 341.Sh LOGIN PROCESS
347When a user successfully logs in, 342When a user successfully logs in,
348.Nm 343.Nm
@@ -476,7 +471,7 @@ A quote may be included in the command by quoting it with a backslash.
476This option might be useful 471This option might be useful
477to restrict certain public keys to perform just a specific operation. 472to restrict certain public keys to perform just a specific operation.
478An example might be a key that permits remote backups but nothing else. 473An example might be a key that permits remote backups but nothing else.
479Note that the client may specify TCP/IP and/or X11 474Note that the client may specify TCP and/or X11
480forwarding unless they are explicitly prohibited. 475forwarding unless they are explicitly prohibited.
481Note that this option applies to shell, command or subsystem execution. 476Note that this option applies to shell, command or subsystem execution.
482.It Cm environment="NAME=value" 477.It Cm environment="NAME=value"
@@ -493,7 +488,7 @@ This option is automatically disabled if
493.Cm UseLogin 488.Cm UseLogin
494is enabled. 489is enabled.
495.It Cm no-port-forwarding 490.It Cm no-port-forwarding
496Forbids TCP/IP forwarding when this key is used for authentication. 491Forbids TCP forwarding when this key is used for authentication.
497Any port forward requests by the client will return an error. 492Any port forward requests by the client will return an error.
498This might be used, e.g., in connection with the 493This might be used, e.g., in connection with the
499.Cm command 494.Cm command
@@ -518,6 +513,12 @@ Multiple
518options may be applied separated by commas. 513options may be applied separated by commas.
519No pattern matching is performed on the specified hostnames, 514No pattern matching is performed on the specified hostnames,
520they must be literal domains or addresses. 515they must be literal domains or addresses.
516.It Cm tunnel="n"
517Force a
518.Xr tun 4
519device on the server.
520Without this option, the next available device will be used if
521the client requests a tunnel.
521.El 522.El
522.Ss Examples 523.Ss Examples
5231024 33 12121...312314325 ylo@foo.bar 5241024 33 12121...312314325 ylo@foo.bar
@@ -527,6 +528,8 @@ from="*.niksula.hut.fi,!pc.niksula.hut.fi" 1024 35 23...2334 ylo@niksula
527command="dump /home",no-pty,no-port-forwarding 1024 33 23...2323 backup.hut.fi 528command="dump /home",no-pty,no-port-forwarding 1024 33 23...2323 backup.hut.fi
528.Pp 529.Pp
529permitopen="10.2.1.55:80",permitopen="10.2.1.56:25" 1024 33 23...2323 530permitopen="10.2.1.55:80",permitopen="10.2.1.56:25" 1024 33 23...2323
531.Pp
532tunnel="0",command="sh /etc/netstart tun0" ssh-rsa AAAA...== reyk@openbsd.org
530.Sh SSH_KNOWN_HOSTS FILE FORMAT 533.Sh SSH_KNOWN_HOSTS FILE FORMAT
531The 534The
532.Pa /etc/ssh/ssh_known_hosts 535.Pa /etc/ssh/ssh_known_hosts