summaryrefslogtreecommitdiff
path: root/sshd.8
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.8')
-rw-r--r--sshd.8388
1 files changed, 235 insertions, 153 deletions
diff --git a/sshd.8 b/sshd.8
index a20490188..3c24210bd 100644
--- a/sshd.8
+++ b/sshd.8
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sat Apr 22 21:55:14 1995 ylo 10.\" Created: Sat Apr 22 21:55:14 1995 ylo
11.\" 11.\"
12.\" $Id: sshd.8,v 1.14 2000/03/17 12:40:18 damien Exp $ 12.\" $Id: sshd.8,v 1.15 2000/03/26 03:04:55 damien Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SSHD 8 15.Dt SSHD 8
@@ -33,39 +33,48 @@
33.Xr ssh 1 . 33.Xr ssh 1 .
34Together these programs replace rlogin and rsh programs, and 34Together these programs replace rlogin and rsh programs, and
35provide secure encrypted communications between two untrusted hosts 35provide secure encrypted communications between two untrusted hosts
36over an insecure network. The programs are intended to be as easy to 36over an insecure network.
37The programs are intended to be as easy to
37install and use as possible. 38install and use as possible.
38.Pp 39.Pp
39.Nm 40.Nm
40is the daemon that listens for connections from clients. It is 41is the daemon that listens for connections from clients.
41normally started at boot from 42It is normally started at boot from
42.Pa /etc/rc . 43.Pa /etc/rc .
43It forks a new 44It forks a new
44daemon for each incoming connection. The forked daemons handle 45daemon for each incoming connection.
46The forked daemons handle
45key exchange, encryption, authentication, command execution, 47key exchange, encryption, authentication, command execution,
46and data exchange. 48and data exchange.
47.Pp 49.Pp
48.Nm 50.Nm
49works as follows. Each host has a host-specific RSA key 51works as follows.
50(normally 1024 bits) used to identify the host. Additionally, when 52Each host has a host-specific RSA key
53(normally 1024 bits) used to identify the host.
54Additionally, when
51the daemon starts, it generates a server RSA key (normally 768 bits). 55the daemon starts, it generates a server RSA key (normally 768 bits).
52This key is normally regenerated every hour if it has been used, and 56This key is normally regenerated every hour if it has been used, and
53is never stored on disk. 57is never stored on disk.
54.Pp 58.Pp
55Whenever a client connects the daemon, the daemon sends its host 59Whenever a client connects the daemon, the daemon sends its host
56and server public keys to the client. The client compares the 60and server public keys to the client.
61The client compares the
57host key against its own database to verify that it has not changed. 62host key against its own database to verify that it has not changed.
58The client then generates a 256 bit random number. It encrypts this 63The client then generates a 256 bit random number.
64It encrypts this
59random number using both the host key and the server key, and sends 65random number using both the host key and the server key, and sends
60the encrypted number to the server. Both sides then start to use this 66the encrypted number to the server.
67Both sides then start to use this
61random number as a session key which is used to encrypt all further 68random number as a session key which is used to encrypt all further
62communications in the session. The rest of the session is encrypted 69communications in the session.
70The rest of the session is encrypted
63using a conventional cipher, currently Blowfish and 3DES, with 3DES 71using a conventional cipher, currently Blowfish and 3DES, with 3DES
64being is used by default. The client selects the encryption algorithm 72being is used by default.
73The client selects the encryption algorithm
65to use from those offered by the server. 74to use from those offered by the server.
66.Pp 75.Pp
67Next, the server and the client enter an authentication dialog. The 76Next, the server and the client enter an authentication dialog.
68client tries to authenticate itself using 77The client tries to authenticate itself using
69.Pa .rhosts 78.Pa .rhosts
70authentication, 79authentication,
71.Pa .rhosts 80.Pa .rhosts
@@ -75,7 +84,8 @@ based authentication.
75.Pp 84.Pp
76Rhosts authentication is normally disabled 85Rhosts authentication is normally disabled
77because it is fundamentally insecure, but can be enabled in the server 86because it is fundamentally insecure, but can be enabled in the server
78configuration file if desired. System security is not improved unless 87configuration file if desired.
88System security is not improved unless
79.Xr rshd 8 , 89.Xr rshd 8 ,
80.Xr rlogind 8 , 90.Xr rlogind 8 ,
81.Xr rexecd 8 , 91.Xr rexecd 8 ,
@@ -88,13 +98,15 @@ and
88into that machine). 98into that machine).
89.Pp 99.Pp
90If the client successfully authenticates itself, a dialog for 100If the client successfully authenticates itself, a dialog for
91preparing the session is entered. At this time the client may request 101preparing the session is entered.
102At this time the client may request
92things like allocating a pseudo-tty, forwarding X11 connections, 103things like allocating a pseudo-tty, forwarding X11 connections,
93forwarding TCP/IP connections, or forwarding the authentication agent 104forwarding TCP/IP connections, or forwarding the authentication agent
94connection over the secure channel. 105connection over the secure channel.
95.Pp 106.Pp
96Finally, the client either requests a shell or execution of a command. 107Finally, the client either requests a shell or execution of a command.
97The sides then enter session mode. In this mode, either side may send 108The sides then enter session mode.
109In this mode, either side may send
98data at any time, and such data is forwarded to/from the shell or 110data at any time, and such data is forwarded to/from the shell or
99command on the server side, and the user terminal in the client side. 111command on the server side, and the user terminal in the client side.
100.Pp 112.Pp
@@ -104,7 +116,8 @@ the client, and both sides exit.
104.Pp 116.Pp
105.Nm 117.Nm
106can be configured using command-line options or a configuration 118can be configured using command-line options or a configuration
107file. Command-line options override values specified in the 119file.
120Command-line options override values specified in the
108configuration file. 121configuration file.
109.Pp 122.Pp
110.Nm 123.Nm
@@ -117,20 +130,23 @@ The options are as follows:
117Specifies the number of bits in the server key (default 768). 130Specifies the number of bits in the server key (default 768).
118.Pp 131.Pp
119.It Fl d 132.It Fl d
120Debug mode. The server sends verbose debug output to the system 133Debug mode.
121log, and does not put itself in the background. The server also will 134The server sends verbose debug output to the system
122not fork and will only process one connection. This option is only 135log, and does not put itself in the background.
123intended for debugging for the server. 136The server also will not fork and will only process one connection.
137This option is only intended for debugging for the server.
124.It Fl f Ar configuration_file 138.It Fl f Ar configuration_file
125Specifies the name of the configuration file. The default is 139Specifies the name of the configuration file.
140The default is
126.Pa /etc/sshd_config . 141.Pa /etc/sshd_config .
127.Nm 142.Nm
128refuses to start if there is no configuration file. 143refuses to start if there is no configuration file.
129.It Fl g Ar login_grace_time 144.It Fl g Ar login_grace_time
130Gives the grace time for clients to authenticate themselves (default 145Gives the grace time for clients to authenticate themselves (default
131300 seconds). If the client fails to authenticate the user within 146300 seconds).
132this many seconds, the server disconnects and exits. A value of zero 147If the client fails to authenticate the user within
133indicates no limit. 148this many seconds, the server disconnects and exits.
149A value of zero indicates no limit.
134.It Fl h Ar host_key_file 150.It Fl h Ar host_key_file
135Specifies the file from which the host key is read (default 151Specifies the file from which the host key is read (default
136.Pa /etc/ssh_host_key ) . 152.Pa /etc/ssh_host_key ) .
@@ -145,24 +161,28 @@ is being run from inetd.
145.Nm 161.Nm
146is normally not run 162is normally not run
147from inetd because it needs to generate the server key before it can 163from inetd because it needs to generate the server key before it can
148respond to the client, and this may take tens of seconds. Clients 164respond to the client, and this may take tens of seconds.
149would have to wait too long if the key was regenerated every time. 165Clients would have to wait too long if the key was regenerated every time.
150However, with small key sizes (e.g., 512) using 166However, with small key sizes (e.g., 512) using
151.Nm 167.Nm
152from inetd may 168from inetd may
153be feasible. 169be feasible.
154.It Fl k Ar key_gen_time 170.It Fl k Ar key_gen_time
155Specifies how often the server key is regenerated (default 3600 171Specifies how often the server key is regenerated (default 3600
156seconds, or one hour). The motivation for regenerating the key fairly 172seconds, or one hour).
173The motivation for regenerating the key fairly
157often is that the key is not stored anywhere, and after about an hour, 174often is that the key is not stored anywhere, and after about an hour,
158it becomes impossible to recover the key for decrypting intercepted 175it becomes impossible to recover the key for decrypting intercepted
159communications even if the machine is cracked into or physically 176communications even if the machine is cracked into or physically
160seized. A value of zero indicates that the key will never be regenerated. 177seized.
178A value of zero indicates that the key will never be regenerated.
161.It Fl p Ar port 179.It Fl p Ar port
162Specifies the port on which the server listens for connections 180Specifies the port on which the server listens for connections
163(default 22). 181(default 22).
164.It Fl q 182.It Fl q
165Quiet mode. Nothing is sent to the system log. Normally the beginning, 183Quiet mode.
184Nothing is sent to the system log.
185Normally the beginning,
166authentication, and termination of each connection is logged. 186authentication, and termination of each connection is logged.
167.It Fl Q 187.It Fl Q
168Do not print an error message if RSA support is missing. 188Do not print an error message if RSA support is missing.
@@ -188,39 +208,43 @@ reads configuration data from
188.Pa /etc/sshd_config 208.Pa /etc/sshd_config
189(or the file specified with 209(or the file specified with
190.Fl f 210.Fl f
191on the command line). The file 211on the command line).
192contains keyword-value pairs, one per line. Lines starting with 212The file contains keyword-value pairs, one per line.
213Lines starting with
193.Ql # 214.Ql #
194and empty lines are interpreted as comments. 215and empty lines are interpreted as comments.
195.Pp 216.Pp
196The following keywords are possible. 217The following keywords are possible.
197.Bl -tag -width Ds 218.Bl -tag -width Ds
198.It Cm AFSTokenPassing 219.It Cm AFSTokenPassing
199Specifies whether an AFS token may be forwarded to the server. Default is 220Specifies whether an AFS token may be forwarded to the server.
221Default is
200.Dq yes . 222.Dq yes .
201.It Cm AllowGroups 223.It Cm AllowGroups
202This keyword can be followed by a number of group names, separated 224This keyword can be followed by a number of group names, separated
203by spaces. If specified, login is allowed only for users whose primary 225by spaces.
226If specified, login is allowed only for users whose primary
204group matches one of the patterns. 227group matches one of the patterns.
205.Ql \&* 228.Ql \&*
206and 229and
207.Ql ? 230.Ql ?
208can be used as 231can be used as
209wildcards in the patterns. Only group names are valid, a numerical group 232wildcards in the patterns.
210id isn't recognized. By default login is allowed regardless of 233Only group names are valid, a numerical group ID isn't recognized.
211the primary group. 234By default login is allowed regardless of the primary group.
212.Pp 235.Pp
213.It Cm AllowUsers 236.It Cm AllowUsers
214This keyword can be followed by a number of user names, separated 237This keyword can be followed by a number of user names, separated
215by spaces. If specified, login is allowed only for users names that 238by spaces.
239If specified, login is allowed only for users names that
216match one of the patterns. 240match one of the patterns.
217.Ql \&* 241.Ql \&*
218and 242and
219.Ql ? 243.Ql ?
220can be used as 244can be used as
221wildcards in the patterns. Only user names are valid, a numerical user 245wildcards in the patterns.
222id isn't recognized. By default login is allowed regardless of 246Only user names are valid, a numerical user ID isn't recognized.
223the user name. 247By default login is allowed regardless of the user name.
224.Pp 248.Pp
225.It Cm CheckMail 249.It Cm CheckMail
226Specifies whether 250Specifies whether
@@ -230,27 +254,27 @@ The default is
230.Dq no . 254.Dq no .
231.It Cm DenyGroups 255.It Cm DenyGroups
232This keyword can be followed by a number of group names, separated 256This keyword can be followed by a number of group names, separated
233by spaces. Users whose primary group matches one of the patterns 257by spaces.
258Users whose primary group matches one of the patterns
234aren't allowed to log in. 259aren't allowed to log in.
235.Ql \&* 260.Ql \&*
236and 261and
237.Ql ? 262.Ql ?
238can be used as 263can be used as
239wildcards in the patterns. Only group names are valid, a numerical group 264wildcards in the patterns.
240id isn't recognized. By default login is allowed regardless of 265Only group names are valid, a numerical group ID isn't recognized.
241the primary group. 266By default login is allowed regardless of the primary group.
242.Pp 267.Pp
243.It Cm DenyUsers 268.It Cm DenyUsers
244This keyword can be followed by a number of user names, separated 269This keyword can be followed by a number of user names, separated
245by spaces. Login is disallowed for user names that match 270by spaces.
246one of the patterns. 271Login is disallowed for user names that match one of the patterns.
247.Ql \&* 272.Ql \&*
248and 273and
249.Ql ? 274.Ql ?
250can be used as 275can be used as wildcards in the patterns.
251wildcards in the patterns. Only user names are valid, a numerical user 276Only user names are valid, a numerical user ID isn't recognized.
252id isn't recognized. By default login is allowed regardless of 277By default login is allowed regardless of the user name.
253the user name.
254.It Cm HostKey 278.It Cm HostKey
255Specifies the file containing the private host key (default 279Specifies the file containing the private host key (default
256.Pa /etc/ssh_host_key ) . 280.Pa /etc/ssh_host_key ) .
@@ -266,7 +290,8 @@ files will not be used in authentication.
266.Pa /etc/hosts.equiv 290.Pa /etc/hosts.equiv
267and 291and
268.Pa /etc/shosts.equiv 292.Pa /etc/shosts.equiv
269are still used. The default is 293are still used.
294The default is
270.Dq yes . 295.Dq yes .
271.It Cm IgnoreUserKnownHosts 296.It Cm IgnoreUserKnownHosts
272Specifies whether 297Specifies whether
@@ -279,10 +304,13 @@ The default is
279.Dq no . 304.Dq no .
280.It Cm KeepAlive 305.It Cm KeepAlive
281Specifies whether the system should send keepalive messages to the 306Specifies whether the system should send keepalive messages to the
282other side. If they are sent, death of the connection or crash of one 307other side.
283of the machines will be properly noticed. However, this means that 308If they are sent, death of the connection or crash of one
309of the machines will be properly noticed.
310However, this means that
284connections will die if the route is down temporarily, and some people 311connections will die if the route is down temporarily, and some people
285find it annoying. On the other hand, if keepalives are not send, 312find it annoying.
313On the other hand, if keepalives are not send,
286sessions may hang indefinitely on the server, leaving 314sessions may hang indefinitely on the server, leaving
287.Dq ghost 315.Dq ghost
288users and consuming server resources. 316users and consuming server resources.
@@ -290,25 +318,27 @@ users and consuming server resources.
290The default is 318The default is
291.Dq yes 319.Dq yes
292(to send keepalives), and the server will notice 320(to send keepalives), and the server will notice
293if the network goes down or the client host reboots. This avoids 321if the network goes down or the client host reboots.
294infinitely hanging sessions. 322This avoids infinitely hanging sessions.
295.Pp 323.Pp
296To disable keepalives, the value should be set to 324To disable keepalives, the value should be set to
297.Dq no 325.Dq no
298in both the server and the client configuration files. 326in both the server and the client configuration files.
299.It Cm KerberosAuthentication 327.It Cm KerberosAuthentication
300Specifies whether Kerberos authentication is allowed. This can 328Specifies whether Kerberos authentication is allowed.
301be in the form of a Kerberos ticket, or if 329This can be in the form of a Kerberos ticket, or if
302.Cm PasswordAuthentication 330.Cm PasswordAuthentication
303is yes, the password provided by the user will be validated through 331is yes, the password provided by the user will be validated through
304the Kerberos KDC. Default is 332the Kerberos KDC.
333Default is
305.Dq yes . 334.Dq yes .
306.It Cm KerberosOrLocalPasswd 335.It Cm KerberosOrLocalPasswd
307If set then if password authentication through Kerberos fails then 336If set then if password authentication through Kerberos fails then
308the password will be validated via any additional local mechanism 337the password will be validated via any additional local mechanism
309such as 338such as
310.Pa /etc/passwd 339.Pa /etc/passwd
311or SecurID. Default is 340or SecurID.
341Default is
312.Dq yes . 342.Dq yes .
313.It Cm KerberosTgtPassing 343.It Cm KerberosTgtPassing
314Specifies whether a Kerberos TGT may be forwarded to the server. 344Specifies whether a Kerberos TGT may be forwarded to the server.
@@ -317,15 +347,18 @@ Default is
317as this only works when the Kerberos KDC is actually an AFS kaserver. 347as this only works when the Kerberos KDC is actually an AFS kaserver.
318.It Cm KerberosTicketCleanup 348.It Cm KerberosTicketCleanup
319Specifies whether to automatically destroy the user's ticket cache 349Specifies whether to automatically destroy the user's ticket cache
320file on logout. Default is 350file on logout.
351Default is
321.Dq yes . 352.Dq yes .
322.It Cm KeyRegenerationInterval 353.It Cm KeyRegenerationInterval
323The server key is automatically regenerated after this many seconds 354The server key is automatically regenerated after this many seconds
324(if it has been used). The purpose of regeneration is to prevent 355(if it has been used).
356The purpose of regeneration is to prevent
325decrypting captured sessions by later breaking into the machine and 357decrypting captured sessions by later breaking into the machine and
326stealing the keys. The key is never stored anywhere. If the value is 358stealing the keys.
3270, the key is never regenerated. The default is 3600 359The key is never stored anywhere.
328(seconds). 360If the value is 0, the key is never regenerated.
361The default is 3600 (seconds).
329.It Cm ListenAddress 362.It Cm ListenAddress
330Specifies what local address 363Specifies what local address
331.Nm 364.Nm
@@ -337,7 +370,8 @@ Additionally, the
337options must precede this option. 370options must precede this option.
338.It Cm LoginGraceTime 371.It Cm LoginGraceTime
339The server disconnects after this time if the user has not 372The server disconnects after this time if the user has not
340successfully logged in. If the value is 0, there is no time limit. 373successfully logged in.
374If the value is 0, there is no time limit.
341The default is 600 (seconds). 375The default is 600 (seconds).
342.It Cm LogLevel 376.It Cm LogLevel
343Gives the verbosity level that is used when logging messages from 377Gives the verbosity level that is used when logging messages from
@@ -353,8 +387,8 @@ The default is
353.Dq yes . 387.Dq yes .
354.It Cm PermitEmptyPasswords 388.It Cm PermitEmptyPasswords
355When password authentication is allowed, it specifies whether the 389When password authentication is allowed, it specifies whether the
356server allows login to accounts with empty password strings. The default 390server allows login to accounts with empty password strings.
357is 391The default is
358.Dq no . 392.Dq no .
359.It Cm PermitRootLogin 393.It Cm PermitRootLogin
360Specifies whether the root can log in using 394Specifies whether the root can log in using
@@ -379,24 +413,27 @@ normally not allowed).
379.It Cm Port 413.It Cm Port
380Specifies the port number that 414Specifies the port number that
381.Nm 415.Nm
382listens on. The default is 22. 416listens on.
417The default is 22.
383Multiple options of this type are permitted. 418Multiple options of this type are permitted.
384.It Cm PrintMotd 419.It Cm PrintMotd
385Specifies whether 420Specifies whether
386.Nm 421.Nm
387should print 422should print
388.Pa /etc/motd 423.Pa /etc/motd
389when a user logs in interactively. (On some systems it is also 424when a user logs in interactively.
390printed by the shell, 425(On some systems it is also printed by the shell,
391.Pa /etc/profile , 426.Pa /etc/profile ,
392or equivalent.) The default is 427or equivalent.)
428The default is
393.Dq yes . 429.Dq yes .
394.It Cm RandomSeed 430.It Cm RandomSeed
395Obsolete. Random number generation uses other techniques. 431Obsolete.
432Random number generation uses other techniques.
396.It Cm RhostsAuthentication 433.It Cm RhostsAuthentication
397Specifies whether authentication using rhosts or /etc/hosts.equiv 434Specifies whether authentication using rhosts or /etc/hosts.equiv
398files is sufficient. Normally, this method should not be permitted 435files is sufficient.
399because it is insecure. 436Normally, this method should not be permitted because it is insecure.
400.Cm RhostsRSAAuthentication 437.Cm RhostsRSAAuthentication
401should be used 438should be used
402instead, because it performs RSA-based host authentication in addition 439instead, because it performs RSA-based host authentication in addition
@@ -405,18 +442,21 @@ The default is
405.Dq no . 442.Dq no .
406.It Cm RhostsRSAAuthentication 443.It Cm RhostsRSAAuthentication
407Specifies whether rhosts or /etc/hosts.equiv authentication together 444Specifies whether rhosts or /etc/hosts.equiv authentication together
408with successful RSA host authentication is allowed. The default is 445with successful RSA host authentication is allowed.
446The default is
409.Dq no . 447.Dq no .
410.It Cm RSAAuthentication 448.It Cm RSAAuthentication
411Specifies whether pure RSA authentication is allowed. The default is 449Specifies whether pure RSA authentication is allowed.
450The default is
412.Dq yes . 451.Dq yes .
413.It Cm ServerKeyBits 452.It Cm ServerKeyBits
414Defines the number of bits in the server key. The minimum value is 453Defines the number of bits in the server key.
415512, and the default is 768. 454The minimum value is 512, and the default is 768.
416.It Cm SkeyAuthentication 455.It Cm SkeyAuthentication
417Specifies whether 456Specifies whether
418.Xr skey 1 457.Xr skey 1
419authentication is allowed. The default is 458authentication is allowed.
459The default is
420.Dq yes . 460.Dq yes .
421Note that s/key authentication is enabled only if 461Note that s/key authentication is enabled only if
422.Cm PasswordAuthentication 462.Cm PasswordAuthentication
@@ -425,29 +465,34 @@ is allowed, too.
425Specifies whether 465Specifies whether
426.Nm 466.Nm
427should check file modes and ownership of the 467should check file modes and ownership of the
428user's files and home directory before accepting login. This 468user's files and home directory before accepting login.
429is normally desirable because novices sometimes accidentally leave their 469This is normally desirable because novices sometimes accidentally leave their
430directory or files world-writable. The default is 470directory or files world-writable.
471The default is
431.Dq yes . 472.Dq yes .
432.It Cm SyslogFacility 473.It Cm SyslogFacility
433Gives the facility code that is used when logging messages from 474Gives the facility code that is used when logging messages from
434.Nm sshd . 475.Nm sshd .
435The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 476The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
436LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. 477LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
478The default is AUTH.
437.It Cm UseLogin 479.It Cm UseLogin
438Specifies whether 480Specifies whether
439.Xr login 1 481.Xr login 1
440is used. The default is 482is used.
483The default is
441.Dq no . 484.Dq no .
442.It Cm X11DisplayOffset 485.It Cm X11DisplayOffset
443Specifies the first display number available for 486Specifies the first display number available for
444.Nm sshd Ns 's 487.Nm sshd Ns 's
445X11 forwarding. This prevents 488X11 forwarding.
489This prevents
446.Nm 490.Nm
447from interfering with real X11 servers. 491from interfering with real X11 servers.
448The default is 10. 492The default is 10.
449.It Cm X11Forwarding 493.It Cm X11Forwarding
450Specifies whether X11 forwarding is permitted. The default is 494Specifies whether X11 forwarding is permitted.
495The default is
451.Dq no . 496.Dq no .
452Note that disabling X11 forwarding does not improve security in any 497Note that disabling X11 forwarding does not improve security in any
453way, as users can always install their own forwarders. 498way, as users can always install their own forwarders.
@@ -489,7 +534,8 @@ If
489exists, runs it; else if 534exists, runs it; else if
490.Pa /etc/sshrc 535.Pa /etc/sshrc
491exists, runs 536exists, runs
492it; otherwise runs xauth. The 537it; otherwise runs xauth.
538The
493.Dq rc 539.Dq rc
494files are given the X11 540files are given the X11
495authentication protocol and cookie in standard input. 541authentication protocol and cookie in standard input.
@@ -500,12 +546,15 @@ Runs user's shell or command.
500The 546The
501.Pa $HOME/.ssh/authorized_keys 547.Pa $HOME/.ssh/authorized_keys
502file lists the RSA keys that are 548file lists the RSA keys that are
503permitted for RSA authentication. Each line of the file contains one 549permitted for RSA authentication.
550Each line of the file contains one
504key (empty lines and lines starting with a 551key (empty lines and lines starting with a
505.Ql # 552.Ql #
506are ignored as 553are ignored as
507comments). Each line consists of the following fields, separated by 554comments).
508spaces: options, bits, exponent, modulus, comment. The options field 555Each line consists of the following fields, separated by
556spaces: options, bits, exponent, modulus, comment.
557The options field
509is optional; its presence is determined by whether the line starts 558is optional; its presence is determined by whether the line starts
510with a number or not (the option field never starts with a number). 559with a number or not (the option field never starts with a number).
511The bits, exponent, modulus and comment fields give the RSA key; the 560The bits, exponent, modulus and comment fields give the RSA key; the
@@ -513,47 +562,58 @@ comment field is not used for anything (but may be convenient for the
513user to identify the key). 562user to identify the key).
514.Pp 563.Pp
515Note that lines in this file are usually several hundred bytes long 564Note that lines in this file are usually several hundred bytes long
516(because of the size of the RSA key modulus). You don't want to type 565(because of the size of the RSA key modulus).
517them in; instead, copy the 566You don't want to type them in; instead, copy the
518.Pa identity.pub 567.Pa identity.pub
519file and edit it. 568file and edit it.
520.Pp 569.Pp
521The options (if present) consists of comma-separated option 570The options (if present) consists of comma-separated option
522specifications. No spaces are permitted, except within double quotes. 571specifications.
572No spaces are permitted, except within double quotes.
523The following option specifications are supported: 573The following option specifications are supported:
524.Bl -tag -width Ds 574.Bl -tag -width Ds
525.It Cm from="pattern-list" 575.It Cm from="pattern-list"
526Specifies that in addition to RSA authentication, the canonical name 576Specifies that in addition to RSA authentication, the canonical name
527of the remote host must be present in the comma-separated list of 577of the remote host must be present in the comma-separated list of
528patterns ('*' and '?' serve as wildcards). The list may also contain 578patterns
529patterns negated by prefixing them with '!'; if the canonical host 579.Pf ( Ql *
530name matches a negated pattern, the key is not accepted. The purpose 580and
581.Ql ?
582serve as wildcards).
583The list may also contain
584patterns negated by prefixing them with
585.Ql ! ;
586if the canonical host name matches a negated pattern, the key is not accepted.
587The purpose
531of this option is to optionally increase security: RSA authentication 588of this option is to optionally increase security: RSA authentication
532by itself does not trust the network or name servers or anything (but 589by itself does not trust the network or name servers or anything (but
533the key); however, if somebody somehow steals the key, the key 590the key); however, if somebody somehow steals the key, the key
534permits an intruder to log in from anywhere in the world. This 591permits an intruder to log in from anywhere in the world.
535additional option makes using a stolen key more difficult (name 592This additional option makes using a stolen key more difficult (name
536servers and/or routers would have to be compromised in addition to 593servers and/or routers would have to be compromised in addition to
537just the key). 594just the key).
538.It Cm command="command" 595.It Cm command="command"
539Specifies that the command is executed whenever this key is used for 596Specifies that the command is executed whenever this key is used for
540authentication. The command supplied by the user (if any) is ignored. 597authentication.
598The command supplied by the user (if any) is ignored.
541The command is run on a pty if the connection requests a pty; 599The command is run on a pty if the connection requests a pty;
542otherwise it is run without a tty. A quote may be included in the 600otherwise it is run without a tty.
543command by quoting it with a backslash. This option might be useful 601A quote may be included in the command by quoting it with a backslash.
544to restrict certain RSA keys to perform just a specific operation. An 602This option might be useful
545example might be a key that permits remote backups but nothing 603to restrict certain RSA keys to perform just a specific operation.
546else. Notice that the client may specify TCP/IP and/or X11 604An example might be a key that permits remote backups but nothing else.
605Notice that the client may specify TCP/IP and/or X11
547forwardings unless they are explicitly prohibited. 606forwardings unless they are explicitly prohibited.
548.It Cm environment="NAME=value" 607.It Cm environment="NAME=value"
549Specifies that the string is to be added to the environment when 608Specifies that the string is to be added to the environment when
550logging in using this key. Environment variables set this way 609logging in using this key.
551override other default environment values. Multiple options of this 610Environment variables set this way
552type are permitted. 611override other default environment values.
612Multiple options of this type are permitted.
553.It Cm no-port-forwarding 613.It Cm no-port-forwarding
554Forbids TCP/IP forwarding when this key is used for authentication. 614Forbids TCP/IP forwarding when this key is used for authentication.
555Any port forward requests by the client will return an error. This 615Any port forward requests by the client will return an error.
556might be used, e.g., in connection with the 616This might be used, e.g., in connection with the
557.Cm command 617.Cm command
558option. 618option.
559.It Cm no-X11-forwarding 619.It Cm no-X11-forwarding
@@ -576,19 +636,21 @@ The
576.Pa /etc/ssh_known_hosts 636.Pa /etc/ssh_known_hosts
577and 637and
578.Pa $HOME/.ssh/known_hosts 638.Pa $HOME/.ssh/known_hosts
579files contain host public keys for all known hosts. The global file should 639files contain host public keys for all known hosts.
580be prepared by the admistrator (optional), and the per-user file is 640The global file should
641be prepared by the administrator (optional), and the per-user file is
581maintained automatically: whenever the user connects an unknown host 642maintained automatically: whenever the user connects an unknown host
582its key is added to the per-user file. 643its key is added to the per-user file.
583.Pp 644.Pp
584Each line in these files contains the following fields: hostnames, 645Each line in these files contains the following fields: hostnames,
585bits, exponent, modulus, comment. The fields are separated by spaces. 646bits, exponent, modulus, comment.
647The fields are separated by spaces.
586.Pp 648.Pp
587Hostnames is a comma-separated list of patterns ('*' and '?' act as 649Hostnames is a comma-separated list of patterns ('*' and '?' act as
588wildcards); each pattern in turn is matched against the canonical host 650wildcards); each pattern in turn is matched against the canonical host
589name (when authenticating a client) or against the user-supplied 651name (when authenticating a client) or against the user-supplied
590name (when authenticating a server). A pattern may also be preceded 652name (when authenticating a server).
591by 653A pattern may also be preceded by
592.Ql ! 654.Ql !
593to indicate negation: if the host name matches a negated 655to indicate negation: if the host name matches a negated
594pattern, it is not accepted (by that line) even if it matched another 656pattern, it is not accepted (by that line) even if it matched another
@@ -604,10 +666,13 @@ Lines starting with
604and empty lines are ignored as comments. 666and empty lines are ignored as comments.
605.Pp 667.Pp
606When performing host authentication, authentication is accepted if any 668When performing host authentication, authentication is accepted if any
607matching line has the proper key. It is thus permissible (but not 669matching line has the proper key.
670It is thus permissible (but not
608recommended) to have several lines or different host keys for the same 671recommended) to have several lines or different host keys for the same
609names. This will inevitably happen when short forms of host names 672names.
610from different domains are put in the file. It is possible 673This will inevitably happen when short forms of host names
674from different domains are put in the file.
675It is possible
611that the files contain conflicting information; authentication is 676that the files contain conflicting information; authentication is
612accepted if valid information can be found from either file. 677accepted if valid information can be found from either file.
613.Pp 678.Pp
@@ -636,7 +701,9 @@ does not start if this file is group/world-accessible.
636.It Pa /etc/ssh_host_key.pub 701.It Pa /etc/ssh_host_key.pub
637Contains the public part of the host key. 702Contains the public part of the host key.
638This file should be world-readable but writable only by 703This file should be world-readable but writable only by
639root. Its contents should match the private part. This file is not 704root.
705Its contents should match the private part.
706This file is not
640really used for anything; it is only provided for the convenience of 707really used for anything; it is only provided for the convenience of
641the user so its contents can be copied to known hosts files. 708the user so its contents can be copied to known hosts files.
642These two files are created using 709These two files are created using
@@ -646,21 +713,22 @@ Contains the process ID of the
646.Nm 713.Nm
647listening for connections (if there are several daemons running 714listening for connections (if there are several daemons running
648concurrently for different ports, this contains the pid of the one 715concurrently for different ports, this contains the pid of the one
649started last). The contents of this file are not sensitive; it can be 716started last).
650world-readable. 717The contents of this file are not sensitive; it can be world-readable.
651.It Pa $HOME/.ssh/authorized_keys 718.It Pa $HOME/.ssh/authorized_keys
652Lists the RSA keys that can be used to log into the user's account. 719Lists the RSA keys that can be used to log into the user's account.
653This file must be readable by root (which may on some machines imply 720This file must be readable by root (which may on some machines imply
654it being world-readable if the user's home directory resides on an NFS 721it being world-readable if the user's home directory resides on an NFS
655volume). It is recommended that it not be accessible by others. The 722volume).
656format of this file is described above. 723It is recommended that it not be accessible by others.
724The format of this file is described above.
657.It Pa "/etc/ssh_known_hosts" and "$HOME/.ssh/known_hosts" 725.It Pa "/etc/ssh_known_hosts" and "$HOME/.ssh/known_hosts"
658These files are consulted when using rhosts with RSA host 726These files are consulted when using rhosts with RSA host
659authentication to check the public key of the host. The key must be 727authentication to check the public key of the host.
660listed in one of these files to be accepted. 728The key must be listed in one of these files to be accepted.
661The client uses the same files 729The client uses the same files
662to verify that the remote host is the one we intended to 730to verify that the remote host is the one we intended to connect.
663connect. These files should be writable only by root/the owner. 731These files should be writable only by root/the owner.
664.Pa /etc/ssh_known_hosts 732.Pa /etc/ssh_known_hosts
665should be world-readable, and 733should be world-readable, and
666.Pa $HOME/.ssh/known_hosts 734.Pa $HOME/.ssh/known_hosts
@@ -668,9 +736,11 @@ can but need not be world-readable.
668.It Pa /etc/nologin 736.It Pa /etc/nologin
669If this file exists, 737If this file exists,
670.Nm 738.Nm
671refuses to let anyone except root log in. The contents of the file 739refuses to let anyone except root log in.
740The contents of the file
672are displayed to anyone trying to log in, and non-root connections are 741are displayed to anyone trying to log in, and non-root connections are
673refused. The file should be world-readable. 742refused.
743The file should be world-readable.
674.It Pa /etc/hosts.allow, /etc/hosts.deny 744.It Pa /etc/hosts.allow, /etc/hosts.deny
675If compiled with 745If compiled with
676.Sy LIBWRAP 746.Sy LIBWRAP
@@ -678,13 +748,16 @@ support, tcp-wrappers access controls may be defined here as described in
678.Xr hosts_access 5 . 748.Xr hosts_access 5 .
679.It Pa $HOME/.rhosts 749.It Pa $HOME/.rhosts
680This file contains host-username pairs, separated by a space, one per 750This file contains host-username pairs, separated by a space, one per
681line. The given user on the corresponding host is permitted to log in 751line.
682without password. The same file is used by rlogind and rshd. 752The given user on the corresponding host is permitted to log in
753without password.
754The same file is used by rlogind and rshd.
683The file must 755The file must
684be writable only by the user; it is recommended that it not be 756be writable only by the user; it is recommended that it not be
685accessible by others. 757accessible by others.
686.Pp 758.Pp
687If is also possible to use netgroups in the file. Either host or user 759If is also possible to use netgroups in the file.
760Either host or user
688name may be of the form +@groupname to specify all hosts or all users 761name may be of the form +@groupname to specify all hosts or all users
689in the group. 762in the group.
690.It Pa $HOME/.shosts 763.It Pa $HOME/.shosts
@@ -696,21 +769,26 @@ not used by rlogin and rshd, so using this permits access using SSH only.
696.Pa /etc/hosts.equiv 769.Pa /etc/hosts.equiv
697This file is used during 770This file is used during
698.Pa .rhosts 771.Pa .rhosts
699authentication. In the 772authentication.
700simplest form, this file contains host names, one per line. Users on 773In the simplest form, this file contains host names, one per line.
774Users on
701those hosts are permitted to log in without a password, provided they 775those hosts are permitted to log in without a password, provided they
702have the same user name on both machines. The host name may also be 776have the same user name on both machines.
777The host name may also be
703followed by a user name; such users are permitted to log in as 778followed by a user name; such users are permitted to log in as
704.Em any 779.Em any
705user on this machine (except root). Additionally, the syntax 780user on this machine (except root).
781Additionally, the syntax
706.Dq +@group 782.Dq +@group
707can be used to specify netgroups. Negated entries start with 783can be used to specify netgroups.
784Negated entries start with
708.Ql \&- . 785.Ql \&- .
709.Pp 786.Pp
710If the client host/user is successfully matched in this file, login is 787If the client host/user is successfully matched in this file, login is
711automatically permitted provided the client and server user names are the 788automatically permitted provided the client and server user names are the
712same. Additionally, successful RSA host authentication is normally 789same.
713required. This file must be writable only by root; it is recommended 790Additionally, successful RSA host authentication is normally required.
791This file must be writable only by root; it is recommended
714that it be world-readable. 792that it be world-readable.
715.Pp 793.Pp
716.Sy "Warning: It is almost never a good idea to use user names in" 794.Sy "Warning: It is almost never a good idea to use user names in"
@@ -718,8 +796,9 @@ that it be world-readable.
718Beware that it really means that the named user(s) can log in as 796Beware that it really means that the named user(s) can log in as
719.Em anybody , 797.Em anybody ,
720which includes bin, daemon, adm, and other accounts that own critical 798which includes bin, daemon, adm, and other accounts that own critical
721binaries and directories. Using a user name practically grants the 799binaries and directories.
722user root access. The only valid use for user names that I can think 800Using a user name practically grants the user root access.
801The only valid use for user names that I can think
723of is in negative entries. 802of is in negative entries.
724.Pp 803.Pp
725Note that this warning also applies to rsh/rlogin. 804Note that this warning also applies to rsh/rlogin.
@@ -729,18 +808,20 @@ This is processed exactly as
729However, this file may be useful in environments that want to run both 808However, this file may be useful in environments that want to run both
730rsh/rlogin and ssh. 809rsh/rlogin and ssh.
731.It Pa $HOME/.ssh/environment 810.It Pa $HOME/.ssh/environment
732This file is read into the environment at login (if it exists). It 811This file is read into the environment at login (if it exists).
733can only contain empty lines, comment lines (that start with 812It can only contain empty lines, comment lines (that start with
734.Ql # ) , 813.Ql # ) ,
735and assignment lines of the form name=value. The file should be writable 814and assignment lines of the form name=value.
815The file should be writable
736only by the user; it need not be readable by anyone else. 816only by the user; it need not be readable by anyone else.
737.It Pa $HOME/.ssh/rc 817.It Pa $HOME/.ssh/rc
738If this file exists, it is run with /bin/sh after reading the 818If this file exists, it is run with /bin/sh after reading the
739environment files but before starting the user's shell or command. If 819environment files but before starting the user's shell or command.
740X11 spoofing is in use, this will receive the "proto cookie" pair in 820If X11 spoofing is in use, this will receive the "proto cookie" pair in
741standard input (and 821standard input (and
742.Ev DISPLAY 822.Ev DISPLAY
743in environment). This must call 823in environment).
824This must call
744.Xr xauth 1 825.Xr xauth 1
745in that case. 826in that case.
746.Pp 827.Pp
@@ -763,12 +844,13 @@ readable by anyone else.
763Like 844Like
764.Pa $HOME/.ssh/rc . 845.Pa $HOME/.ssh/rc .
765This can be used to specify 846This can be used to specify
766machine-specific login-time initializations globally. This file 847machine-specific login-time initializations globally.
767should be writable only by root, and should be world-readable. 848This file should be writable only by root, and should be world-readable.
768.Sh AUTHOR 849.Sh AUTHOR
769OpenSSH 850OpenSSH
770is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen, 851is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
771but with bugs removed and newer features re-added. Rapidly after the 852but with bugs removed and newer features re-added.
853Rapidly after the
7721.2.12 release, newer versions of the original ssh bore successively 8541.2.12 release, newer versions of the original ssh bore successively
773more restrictive licenses, and thus demand for a free version was born. 855more restrictive licenses, and thus demand for a free version was born.
774This version of OpenSSH 856This version of OpenSSH