📄 sshd_config.5
字号:
.\" -*- nroff -*-.\".\" Author: Tatu Ylonen <ylo@cs.hut.fi>.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland.\" All rights reserved.\".\" As far as I am concerned, the code I have written for this software.\" can be used freely for any purpose. Any derived versions of this.\" software must be clearly marked as such, and if the derived work is.\" incompatible with the protocol description in the RFC file, it must be.\" called by a name other than "ssh" or "Secure Shell"..\".\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved..\" Copyright (c) 1999 Aaron Campbell. All rights reserved..\" Copyright (c) 1999 Theo de Raadt. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\".\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED..\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE..\".\" $OpenBSD: sshd_config.5,v 1.15 2003/03/28 10:11:43 jmc Exp $.Dd September 25, 1999.Dt SSHD_CONFIG 5.Os.Sh NAME.Nm sshd_config.Nd OpenSSH SSH daemon configuration file.Sh SYNOPSIS.Bl -tag -width Ds -compact.It Pa /etc/ssh/sshd_config.El.Sh DESCRIPTION.Nm sshdreads configuration data from.Pa /etc/ssh/sshd_config(or the file specified with.Fl fon the command line).The file contains keyword-argument pairs, one per line.Lines starting with.Ql #and empty lines are interpreted as comments..PpThe possiblekeywords and their meanings are as follows (note thatkeywords are case-insensitive and arguments are case-sensitive):.Bl -tag -width Ds.It Cm AFSTokenPassingSpecifies whether an AFS token may be forwarded to the server.Default is.Dq no ..It Cm AllowGroupsThis keyword can be followed by a list of group name patterns, separatedby spaces.If specified, login is allowed only for users whose primarygroup or supplementary group list matches one of the patterns..Ql \&*and.Ql ?can be used aswildcards in the patterns.Only group names are valid; a numerical group ID is not recognized.By default, login is allowed for all groups..Pp.It Cm AllowTcpForwardingSpecifies whether TCP forwarding is permitted.The default is.Dq yes .Note that disabling TCP forwarding does not improve security unlessusers are also denied shell access, as they can always install theirown forwarders..Pp.It Cm AllowUsersThis keyword can be followed by a list of user name patterns, separatedby spaces.If specified, login is allowed only for user names thatmatch one of the patterns..Ql \&*and.Ql ?can be used aswildcards in the patterns.Only user names are valid; a numerical user ID is not recognized.By default, login is allowed for all users.If the pattern takes the form USER@HOST then USER and HOSTare separately checked, restricting logins to particularusers from particular hosts..Pp.It Cm AuthorizedKeysFileSpecifies the file that contains the public keys that can be usedfor user authentication..Cm AuthorizedKeysFilemay contain tokens of the form %T which are substituted during connectionset-up. The following tokens are defined: %% is replaced by a literal '%',%h is replaced by the home directory of the user being authenticated and%u is replaced by the username of that user.After expansion,.Cm AuthorizedKeysFileis taken to be an absolute path or one relative to the user's homedirectory.The default is.Dq .ssh/authorized_keys ..It Cm BannerIn some jurisdictions, sending a warning message before authenticationmay be relevant for getting legal protection.The contents of the specified file are sent to the remote user beforeauthentication is allowed.This option is only available for protocol version 2.By default, no banner is displayed..Pp.It Cm ChallengeResponseAuthenticationSpecifies whether challenge response authentication is allowed.All authentication styles from.Xr login.conf 5are supported.The default is.Dq yes ..It Cm CiphersSpecifies the ciphers allowed for protocol version 2.Multiple ciphers must be comma-separated.The default is.Pp.Bd -literal ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, aes192-cbc,aes256-cbc''.Ed.It Cm ClientAliveIntervalSets a timeout interval in seconds after which if no data has been receivedfrom the client,.Nm sshdwill send a message through the encryptedchannel to request a response from the client.The defaultis 0, indicating that these messages will not be sent to the client.This option applies to protocol version 2 only..It Cm ClientAliveCountMaxSets the number of client alive messages (see above) which may besent without.Nm sshdreceiving any messages back from the client. If this threshold isreached while client alive messages are being sent,.Nm sshdwill disconnect the client, terminating the session. It is importantto note that the use of client alive messages is very different from.Cm KeepAlive(below). The client alive messages are sent through theencrypted channel and therefore will not be spoofable. The TCP keepaliveoption enabled by.Cm KeepAliveis spoofable. The client alive mechanism is valuable when the client orserver depend on knowing when a connection has become inactive..PpThe default value is 3. If.Cm ClientAliveInterval(above) is set to 15, and.Cm ClientAliveCountMaxis left at the default, unresponsive ssh clientswill be disconnected after approximately 45 seconds..It Cm CompressionSpecifies whether compression is allowed.The argument must be.Dq yesor.Dq no .The default is.Dq yes ..It Cm DenyGroupsThis keyword can be followed by a list of group name patterns, separatedby spaces.Login is disallowed for users whose primary group or supplementarygroup list matches one of the patterns..Ql \&*and.Ql ?can be used aswildcards in the patterns.Only group names are valid; a numerical group ID is not recognized.By default, login is allowed for all groups..Pp.It Cm DenyUsersThis keyword can be followed by a list of user name patterns, separatedby spaces.Login is disallowed for user names that match one of the patterns..Ql \&*and.Ql ?can be used as wildcards in the patterns.Only user names are valid; a numerical user ID is not recognized.By default, login is allowed for all users.If the pattern takes the form USER@HOST then USER and HOSTare separately checked, restricting logins to particularusers from particular hosts..It Cm GatewayPortsSpecifies whether remote hosts are allowed to connect to portsforwarded for the client.By default,.Nm sshdbinds remote port forwardings to the loopback address.This prevents other remote hosts from connecting to forwarded ports..Cm GatewayPortscan be used to specify that.Nm sshdshould bind remote port forwardings to the wildcard address,thus allowing remote hosts to connect to forwarded ports.The argument must be.Dq yesor.Dq no .The default is.Dq no ..It Cm HostbasedAuthenticationSpecifies whether rhosts or /etc/hosts.equiv authentication togetherwith successful public key client host authentication is allowed(hostbased authentication).This option is similar to.Cm RhostsRSAAuthenticationand applies to protocol version 2 only.The default is.Dq no ..It Cm HostKeySpecifies a file containing a private host keyused by SSH.The default is.Pa /etc/ssh/ssh_host_keyfor protocol version 1, and.Pa /etc/ssh/ssh_host_rsa_keyand.Pa /etc/ssh/ssh_host_dsa_keyfor protocol version 2.Note that.Nm sshdwill refuse to use a file if it is group/world-accessible.It is possible to have multiple host key files..Dq rsa1keys are used for version 1 and.Dq dsaor.Dq rsaare used for version 2 of the SSH protocol..It Cm IgnoreRhostsSpecifies that.Pa .rhostsand.Pa .shostsfiles will not be used in.Cm RhostsAuthentication ,.Cm RhostsRSAAuthenticationor.Cm HostbasedAuthentication ..Pp.Pa /etc/hosts.equivand.Pa /etc/shosts.equivare still used.The default is.Dq yes ..It Cm IgnoreUserKnownHostsSpecifies whether.Nm sshdshould ignore the user's.Pa $HOME/.ssh/known_hostsduring.Cm RhostsRSAAuthenticationor.Cm HostbasedAuthentication .The default is.Dq no ..It Cm KeepAliveSpecifies whether the system should send TCP keepalive messages to theother side.If they are sent, death of the connection or crash of oneof the machines will be properly noticed.However, this means thatconnections will die if the route is down temporarily, and some peoplefind it annoying.On the other hand, if keepalives are not sent,sessions may hang indefinitely on the server, leaving.Dq ghostusers and consuming server resources..PpThe default is.Dq yes(to send keepalives), and the server will noticeif the network goes down or the client host crashes.This avoids infinitely hanging sessions..PpTo disable keepalives, the value should be set to.Dq no ..It Cm KerberosAuthenticationSpecifies whether Kerberos authentication is allowed.This can be in the form of a Kerberos ticket, or if.Cm PasswordAuthenticationis yes, the password provided by the user will be validated throughthe Kerberos KDC.To use this option, the server needs aKerberos servtab which allows the verification of the KDC's identity.Default is.Dq no ..It Cm KerberosOrLocalPasswdIf set then if password authentication through Kerberos fails thenthe password will be validated via any additional local mechanismsuch as.Pa /etc/passwd .Default is.Dq yes ..It Cm KerberosTgtPassingSpecifies whether a Kerberos TGT may be forwarded to the server.Default is.Dq no ,as this only works when the Kerberos KDC is actually an AFS kaserver..It Cm KerberosTicketCleanupSpecifies whether to automatically destroy the user's ticket cachefile on logout.Default is.Dq yes ..It Cm KeyRegenerationIntervalIn protocol version 1, the ephemeral server key is automatically regeneratedafter this many seconds (if it has been used).The purpose of regeneration is to preventdecrypting captured sessions by later breaking into the machine andstealing the keys.The key is never stored anywhere.If the value is 0, the key is never regenerated.The default is 3600 (seconds)..It Cm ListenAddressSpecifies the local addresses.Nm sshdshould listen on.The following forms may be used:.Pp.Bl -item -offset indent -compact.It.Cm ListenAddress.Sm off.Ar host No | Ar IPv4_addr No | Ar IPv6_addr.Sm on.It.Cm ListenAddress.Sm off.Ar host No | Ar IPv4_addr No : Ar port.Sm on.It.Cm ListenAddress.Sm off.Oo.Ar host No | Ar IPv6_addr Oc : Ar port.Sm on.El.PpIf.Ar portis not specified,.Nm sshdwill listen on the address and all prior.Cm Portoptions specified. The default is to listen on all localaddresses.Multiple.Cm ListenAddressoptions are permitted. Additionally, any.Cm Portoptions must precede this option for non port qualified addresses..It Cm LoginGraceTime
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -