SSHD_CONFIG(5)
π NAME π
sshd_config β OpenSSH daemon configuration file. And yes bestie, this is page SSHD_CONFIG(5) from the File Formats Manual, we're literally in our terminal glow-up era. π
β¨ DESCRIPTION β¨
Okay so sshd(8) reads its config data from /etc/gsissh/sshd_config (or whatever file you pass with -f on the command line). The file is just keyword-argument pairs, one per line. Unless it says otherwise, for each keyword, the first obtained value wins β first come, first served, no take-backs. Lines starting with # and empty lines? Comments, obviously. And arguments can optionally be wrapped in double quotes (") if they contain spaces, because spaces are messy.
Also hpnsshd(8) is fully compatible with OpenSSH's sshd and uses the same configuration format, directives, and options. hpnsshd(8) can use the same config file as sshd(8), though the inverse is not necessarily true β because hpnssh(8) has some extra options that we'll talk about below. So admins, please keep separate config files for each, no cap. π₯
The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive):
AcceptEnvβ Tells you which environment variables the client sends that get copied into the session'senviron(7). Wanna configure the client? Check outSendEnvandSetEnvinssh_config(5). TheTERMvariable is always accepted whenever the client asks for a pseudo-terminal, because the protocol literally requires it. Variables are specified by name, and they can have wildcard characters*and?. You can separate multiple env vars with whitespace or just spread them across multipleAcceptEnvdirectives. But bestie, be warned: some env vars could be used to bypass restricted user environments, so be careful with this directive, fr. Default? It does not accept any environment variables. πAddressFamilyβ Picks which address familysshd(8)should use. Valid arguments:any(the default),inet(IPv4 only), orinet6(IPv6 only). Slay.AllowAgentForwardingβ Says whetherssh-agent(1)forwarding is permitted. Default isyes. Note: disabling agent forwarding does not improve security unless users are also denied shell access, because they can always install their own forwarders. So it's giving false sense of security, lowkey.AllowGroupsβ This keyword can be followed by a list of group name patterns, separated by spaces. If you specify it, login is allowed only for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid; a numerical group ID is not recognized. By default, login is allowed for all groups. The allow/deny groups directives are processed in this order:DenyGroups,AllowGroups.
See PATTERNS in ssh_config(5) for more info on patterns. This keyword may appear multiple times in sshd_config, and each instance appends to the list. Obsessed.
AllowStreamLocalForwardingβ Says whether StreamLocal (Unix-domain socket) forwarding is permitted. Options:yes(the default) orallto allow StreamLocal forwarding,noto prevent all StreamLocal forwarding,localto allow local (from the perspective ofssh(1)) forwarding only, orremoteto allow remote forwarding only. Note: disabling StreamLocal forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. Same vibe as above, bestie.AllowTcpForwardingβ Says whether TCP forwarding is permitted. Options:yes(the default) orallto allow TCP forwarding,noto prevent all TCP forwarding,localto allow local (from the perspective ofssh(1)) forwarding only, orremoteto allow remote forwarding only. Note: disabling TCP forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. Periodt.AllowUsersβ This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for user names that match one of 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 isUSER@HOST, thenUSERandHOSTare separately checked, restricting logins to particular users from particular hosts.HOSTcriteria may additionally contain addresses to match in CIDR address/masklen format. The allow/deny users directives are processed in this order:DenyUsers,AllowUsers.
See PATTERNS in ssh_config(5) for more info on patterns. This keyword may appear multiple times in sshd_config, and each instance appends to the list. We love a stacking queen. π
AuthenticationMethodsβ Specifies the authentication methods that must be successfully completed for a user to be granted access. This option must be followed by one or more lists of comma-separated authentication method names, or by the single stringanyto indicate the default behaviour of accepting any single authentication method. If you override the default, then successful authentication requires completion of every method in at least one of these lists.
For example, "publickey,password publickey,keyboard-interactive" would require the user to complete public key authentication, followed by either password or keyboard interactive authentication. Only methods that are next in one or more lists are offered at each stage, so for this example it would not be possible to attempt password or keyboard-interactive authentication before public key. So order matters, bestie.
For keyboard interactive authentication, you can also restrict authentication to a specific device by appending a colon followed by the device identifier bsdauth or pam, depending on the server configuration. For example, "keyboard-interactive:bsdauth" would restrict keyboard interactive authentication to the bsdauth device.
If the publickey method is listed more than once, sshd(8) verifies that keys that have been used successfully are not reused for subsequent authentications. For example, "publickey,publickey" requires successful authentication using two different public keys. No reusing keys, that's not very demure.
Note that each authentication method listed should also be explicitly enabled in the configuration.
The available authentication methods are: "gssapi-with-mic", "hostbased", "keyboard-interactive", "none" (used for access to password-less accounts when PermitEmptyPasswords is enabled), "password" and "publickey". Iconic list, honestly.
AuthorizedKeysCommandβ Specifies a program to look up the user's public keys. The program must be owned byroot, not writable by group or others, and specified by an absolute path. Arguments toAuthorizedKeysCommandaccept the tokens described in the βTOKENSβ section. If no arguments are specified, then the username of the target user is used.
The program should produce on standard output zero or more lines of authorized_keys output (see AUTHORIZED_KEYS in sshd(8)). AuthorizedKeysCommand is tried after the usual AuthorizedKeysFile files and will not be executed if a matching key is found there. By default, no AuthorizedKeysCommand is run. So it's a backup plan, lowkey.
AuthorizedKeysCommandUserβ Specifies the user under whose account theAuthorizedKeysCommandis run. It is recommended to use a dedicated user that has no other role on the host than running authorized keys commands. IfAuthorizedKeysCommandis specified butAuthorizedKeysCommandUseris not, thensshd(8)will refuse to start. So don't forget this, bestie, or it's a no-go.AuthorizedKeysFileβ Specifies the file that contains the public keys used for user authentication. The format is described in theAUTHORIZED_KEYS FILE FORMATsection ofsshd(8). Arguments toAuthorizedKeysFilemay include wildcards and accept the tokens described in the βTOKENSβ section. After expansion,AuthorizedKeysFileis taken to be an absolute path or one relative to the user's home directory. Multiple files may be listed, separated by whitespace. Alternately, this option may be set tononeto skip checking for user keys in files. The default is".ssh/authorized_keys .ssh/authorized_keys2". Cute default, ngl.AuthorizedPrincipalsCommandβ Specifies a program to generate the list of allowed certificate principals as perAuthorizedPrincipalsFile. The program must be owned byroot, not writable by group or others, and specified by an absolute path. Arguments toAuthorizedPrincipalsCommandaccept the tokens described in the βTOKENSβ section. If no arguments are specified, then the username of the target user is used.
The program should produce on standard output zero or more lines of AuthorizedPrincipalsFile output. If either AuthorizedPrincipalsCommand or AuthorizedPrincipalsFile is specified, then certificates offered by the client for authentication must contain a principal that is listed. By default, no AuthorizedPrincipalsCommand is run. So it's a whole vibe.
AuthorizedPrincipalsCommandUserβ Specifies the user under whose account theAuthorizedPrincipalsCommandis run. It is recommended to use a dedicated user that has no other role on the host than running authorized principals commands. IfAuthorizedPrincipalsCommandis specified butAuthorizedPrincipalsCommandUseris not, thensshd(8)will refuse to start. Same energy as before: don't skip this.AuthorizedPrincipalsFileβ Specifies a file that lists principal names that are accepted for certificate authentication. When using certificates signed by a key listed inTrustedUserCAKeys, this file lists names, one of which must appear in the certificate for it to be accepted for authentication. Names are listed one per line preceded by key options (as described inAUTHORIZED_KEYS FILE FORMATinsshd(8)). Empty lines and comments starting with#are ignored. So clean.
Okay so back to the wildcards-and-tokens situation for AuthorizedPrincipalsFile β¨ it can take wildcards, and it can take all the tokens from the βTOKENSβ section (iykyk, we'll get there). Once everything's been expanded, AuthorizedPrincipalsFile gets read as either an absolute path or a path relative to the user's home directory. The default is none, aka no principals file at all β and in that case the user's username must show up in the certificate's principals list or the whole thing gets rejected, no exceptions π
Heads up bestie:AuthorizedPrincipalsFileonly does anything when auth happens through a CA listed inTrustedUserCAKeys. It is not consulted for CAs you trust via~/.ssh/authorized_keysβ although theprincipals=key option does a similar job (peepsshd(8)for the deets).
π Banner π
Whatever's inside the file you name here gets sent to the remote user before authentication is even allowed. If the argument is none, no banner gets displayed. And by default? No banner. Nothing. Silence. π
π CASignatureAlgorithms π
The default here is handled system-wide by crypto-policies(7). All the info about what the defaults are, how to change them, and how to customize existing policies with sub-policies lives in update-crypto-policies(8).
This one specifies which algorithms are allowed for signing certificates by certificate authorities (CAs). Here's the vibe:
- If your list starts with a
+character, the algorithms you list get appended to the default set instead of replacing it. - If your list starts with a
-character, the algorithms you list (wildcards included!) get removed from the default set instead of replacing it.
Certificates signed with any other algorithm? Not accepted for public key or host-based authentication. Periodt. π«
π¦ ChannelTimeout π¦
This one decides whether and how fast sshd(8) should close channels that go inactive. You write timeouts as one or more type=interval pairs, separated by whitespace, where type is either the special keyword global or one of the channel type names from the list below β and yeah, it can contain wildcard characters π
The interval is in seconds, or you can use any of the units documented in the βTIME FORMATSβ section. Like, session=5m would make interactive sessions dip out after five minutes of nothing happening. And setting a zero value disables the inactivity timeout entirely.
The special timeout global applies to all active channels taken together. Traffic on any active channel resets the timer, but once it expires, all open channels get closed. Lowkey important: this global timeout is not matched by wildcards β you have to specify it explicitly.
The channel type names you can use are:
π agent-connection
Open connections to ssh-agent(1).
π direct-tcpip, direct-streamlocal@openssh.com
Open TCP or Unix socket (respectively) connections that were established from an ssh(1) local forwarding β so like, LocalForward or DynamicForward.
π forwarded-tcpip, forwarded-streamlocal@openssh.com
Open TCP or Unix socket (respectively) connections established to an sshd(8) listening on behalf of an ssh(1) remote forwarding, i.e. RemoteForward.
π session
The interactive main session β shell session, command execution, scp(1), sftp(1), all of it.
π tun-connection
Open TunnelForward connections.
π x11-connection
Open X11 forwarding sessions.
Now the fine print, and it matters:
Terminating an inactive session does not guarantee that all resources tied to that session get cleaned up. Shell processes or X11 clients relating to the session may keep right on executing. π
Also β killing an inactive channel or session doesn't necessarily close the SSH connection, and it doesn't stop a client from asking for another channel of the same type. Specifically, expiring an inactive forwarding session does not prevent another identical forwarding from being created right after. Sneaky.
The default is not to expire channels of any type for inactivity. Very chill of it.
π§ ChrootDirectory π§
This is the pathname of a directory to chroot(2) to after authentication. At session startup, sshd(8) checks that every single component of that pathname is a root-owned directory that isn't writable by group or others. After the chroot, sshd(8) changes the working directory to the user's home directory. Arguments to ChrootDirectory accept the tokens described in the βTOKENSβ section.
Your ChrootDirectory has to actually contain the files and directories needed to support the user's session. For an interactive session that means at minimum a shell β typically sh(1) β plus the basic /dev nodes like null(4), zero(4), stdin(4), stdout(4), stderr(4), and tty(4) devices. For file transfer sessions using SFTP, no extra environment config is needed if the in-process sftp-server is used β though sessions that use logging may need /dev/log inside the chroot directory on some operating systems (check sftp-server(8) for that).
π¨ For safety, it is very important that the directory hierarchy can't be modified by other processes on the system β especially ones outside the jail. Misconfiguration can lead to unsafe environments that sshd(8) literally cannot detect. Be careful, bestie.
The default is none, which means don't chroot(2) at all.
β Ciphers β
The default here is handled system-wide by crypto-policies(7). Info about the defaults, how to modify them, and how to customize existing policies with sub-policies is all in update-crypto-policies(8).
This specifies which ciphers are allowed. Multiple ciphers go comma-separated. And here's the prefix lore:
- Starts with
+β the ciphers you list get appended to the built-in openssh default set instead of replacing it. - Starts with
-β the ciphers you list (wildcards included!) get removed from the built-in openssh default set instead of replacing it. - Starts with
^β the ciphers you list get placed at the head of the built-in openssh default set. Main character energy π
The supported ciphers are:
3des-cbcaes128-cbcaes192-cbcaes256-cbcaes128-ctraes192-ctraes256-ctraes128-gcm@openssh.comaes256-gcm@openssh.comchacha20-poly1305@openssh.com
You can also just ask for the list of available ciphers with "ssh -Q cipher". Handy!
π ClientAliveCountMax π
Sets how many client alive messages can be sent without sshd(8) getting any messages back from the client. If that threshold gets hit while client alive messages are still being sent, sshd disconnects the client and terminates the session. Bye π
Okay and this is genuinely important: client alive messages are very different from TCPKeepAlive. The client alive messages go through the encrypted channel, so they cannot be spoofed. The TCP keepalive option that TCPKeepAlive turns on can be spoofed. The client alive mechanism is valuable when the client or server depends on knowing when a connection has gone unresponsive.
The default value is 3. So if ClientAliveInterval is set to 15 and ClientAliveCountMax is left at the default, unresponsive SSH clients get disconnected after approximately 45 seconds. And setting a zero ClientAliveCountMax disables connection termination.
πΈ ClientAliveInterval πΈ
Sets a timeout interval in seconds β after that much time with no data received from the client, sshd(8) sends a message through the encrypted channel asking the client to respond. The default is 0, which means these messages just... don't get sent. π€·
π Compression π
Specifies whether compression is enabled after the user has authenticated successfully. The argument has to be yes, delayed (a legacy synonym for yes), or no. The default is yes.
π«Ά DenyGroups π«Ά
This keyword can be followed by a list of group name patterns, separated by spaces. Login is disallowed for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid β a numerical group ID is not recognized, don't try it. By default, login is allowed for all groups.
The allow/deny groups directives get processed in this order: DenyGroups, AllowGroups.
See PATTERNS in ssh_config(5) for more on patterns. And this keyword can appear multiple times in sshd_config β each instance appends to the list. β¨
π DenyUsers π
Same energy, but for users. This keyword can be followed by a list of user name patterns, separated by spaces. Login is disallowed for user names that match one of 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 HOST are checked separately, which restricts logins to particular users from particular hosts. And HOST criteria can additionally contain addresses to match in CIDR address/masklen format. The allow/deny users directives get processed in this order: DenyUsers, AllowUsers.
See PATTERNS in ssh_config(5) for more on patterns. This keyword can also appear multiple times in sshd_config, each instance appending to the list. π
π₯ DisableForwarding π₯
Disables all the forwarding features β X11, ssh-agent(1), TCP and StreamLocal. This option overrides every other forwarding-related option, and it may simplify restricted configurations. One flag to shut them all down, iconic honestly.
πΈ DisableMTAES
okay so this one switches your encryption cipher from the multithreaded MT-AES-CTR cipher back to the stock single-threaded AES-CTR cipher. Default is no. and yeah, tiny detail: this is HPNSSH only β if you're not running HPNSSH this option is literally just vibing there doing nothing π
π¦ ExposeAuthInfo
writes a temporary file that contains a list of authentication methods and public credentials (like keys, bestie, keys) that were used to authenticate the user. the location of that file gets exposed to the user session through the SSH_USER_AUTH environment variable. The default is no.
β FingerprintHash
says which hash algorithm gets used when logging key fingerprints. Valid options are: md5 and sha256. The default is sha256. no cap, sha256 is the moment β¨
π ForceCommand
forces the execution of the command you specify with ForceCommand, and it ignores any command supplied by the client plus ~/.ssh/rc if that's present. The command is invoked by using the user's login shell with the -c option. This applies to shell, command, or subsystem execution. It is most useful inside a Match block. The command that the client originally supplied is available in the SSH_ORIGINAL_COMMAND environment variable. If you specify a command of internal-sftp, that will force the use of an in-process SFTP server that requires no support files when used with ChrootDirectory. The default is none.
π GatewayPorts
specifies whether remote hosts are allowed to connect to ports forwarded for the client. By default, sshd(8) binds remote port forwardings to the loopback address β which stops other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that sshd should allow remote port forwardings to bind to non-loopback addresses, which then lets other hosts connect. The argument may be:
noβ force remote port forwardings to be available to the local host onlyyesβ force remote port forwardings to bind to the wildcard addressclientspecifiedβ allow the client to select the address to which the forwarding is bound
The default is no.
π GSIAllowLimitedProxy
specifies whether to accept limited proxy credentials for authentication. The default is no.
π GSSAPIAuthentication
specifies whether user authentication based on GSSAPI is allowed. The default is yes.
β¨ GSSAPICleanupCredentials
specifies whether to automatically destroy the user's credentials cache on logout. The default is yes.
π GSSAPICredentialsPath
if specified, the delegated GSSAPI credential is stored in the given path, overwriting any existing credentials. Paths can be specified with syntax similar to the AuthorizedKeysFile option (i.e., accepting %h and %u tokens). When you're using this option, setting 'GssapiCleanupCredentials no' is recommended, so that logging out of one session doesn't remove the credentials in use by another session of the same user. Currently only implemented for the GSI mechanism.
π§ GSSAPIDelegateCredentials
Accept delegated credentials on the server side. The default is
π₯ GSSAPIEnablek5users
specifies whether to look at the .k5users file for GSSAPI authentication access control. Further details are described in ksu(1). The default is no.
πΈ GSSAPIKeyExchange
specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange doesn't rely on ssh keys to verify host identity. The default is yes.
π«Ά GSSAPIStrictAcceptorCheck
determines whether to be strict about the identity of the GSSAPI acceptor that a client authenticates against. If set to yes then the client must authenticate against the host service on the current hostname. If set to no then the client may authenticate against any service key stored in the machine's default store. This facility is provided to assist with operation on multi homed machines. The default is yes.
π GSSAPIStoreCredentialsOnRekey
controls whether the user's GSSAPI credentials should be updated following a successful connection rekeying. This option can be used to accept renewed or updated credentials from a compatible client. The default is βnoβ.
For this to work GSSAPIKeyExchange needs to be enabled in the server and also used by the client. iykyk π
π GSSAPIKexAlgorithms
The default is handled system-wide by crypto-policies(7). Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page update-crypto-policies(8).
The list of key exchange algorithms that are accepted by GSSAPI key exchange. Possible values are
gss-gex-sha1-
gss-group1-sha1-
gss-group14-sha1-
gss-group14-sha256-
gss-group16-sha512-
gss-nistp256-sha256-
gss-curve25519-sha256-
This option only applies to connections using GSSAPI.
The list of supported key exchange algorithms may also be obtained using "ssh -Q GSSAPIKexAlgorithms".
π GSSAPIIndicators
specifies whether to accept or deny GSSAPI authenticated access if the Kerberos mechanism is used and the Kerberos ticket contains a particular set of authentication indicators. The values can be specified as a comma-separated list [!]name1,[!]name2,.... When an indicator's name is prefixed with !, the authentication indicator name will deny access to the system. Otherwise, one of the non-negated authentication indicators must be present in the Kerberos ticket to allow access. If GSSAPIIndicators is defined, a Kerberos ticket that has indicators but does not match the policy will get denial. If at least one indicator is configured, whether for access or denial, tickets without authentication indicators will be explicitly rejected.
By default systems using MIT Kerberos 1.17 or later will not assign any indicators. SPAKE and PKINIT methods add authentication indicators to all successful authentications. The SPAKE pre-authentication method is preferred over an encrypted timestamp pre-authentication when passwords used to authenticate user principals. Kerberos KDCs built with Heimdal Kerberos (including Samba AD DC built with Heimdal) do not add authentication indicators. However, OpenSSH built against Heimdal Kerberos library is able to inquire authentication indicators and thus can be used to check for their presence.
Indicator name is case-sensitive and depends on the configuration of a particular Kerberos deployment. Indicators available in MIT Kerberos and FreeIPA environments:
hardenedβ SPAKE or encrypted timestamp pre-authentication mechanisms in MIT Kerberos and FreeIPApkinitβ smartcard or PKCS11 token-based pre-authentication in MIT Kerberos and FreeIPAradiusβ pre-authentication based on a RADIUS server in MIT Kerberos and FreeIPAotpβ TOTP/HOTP-based two-factor pre-authentication in FreeIPAidpβ OAuth2-based pre-authentication in FreeIPA using an external identity provider and device authorization grant flowpasskeyβ FIDO2-based pre-authentication in FreeIPA, using FIDO2 USB and NFC tokens
The default βnoneβ is to not use GSSAPI authentication indicators for access decisions.
π
HostbasedAcceptedAlgorithms
The default is handled system-wide by crypto-policies(7). Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page update-crypto-policies(8).
specifies the signature algorithms that will be accepted for hostbased authentication as a list of comma-separated patterns. And bestie, the prefix characters actually do stuff:
- if the specified list begins with a
β+βcharacter, then the specified signature algorithms will be appended to the built-in openssh default set instead of replacing them. - if the specified list begins with a
β-βcharacter, then the specified signature algorithms (including wildcards) will be removed from the built-in openssh default set instead of replacing them. - if the specified list begins with a
β^βcharacter, then the specified signature algorithms will be placed at the head of the built-in openssh default set.
The list of available signature algorithms may also be obtained using "ssh -Q HostbasedAcceptedAlgorithms". This was formerly named HostbasedAcceptedKeyTypes. glow-up moment β¨
π HostbasedAuthentication
specifies whether rhosts or /etc/hosts.equiv authentication together with successful public key client host authentication is allowed (host-based authentication). The default is no.
π¦ HostbasedUsesNameFromPacketOnly
specifies whether or not the server will attempt to perform a reverse name lookup when matching the name in the ~/.shosts, ~/.rhosts, and /etc/hosts.equiv files during HostbasedAuthentication. A setting of yes means that sshd(8) uses the name supplied by the client rather than attempting to resolve the name from the TCP connection itself. The default is no.
β HostCertificate
specifies a file containing a public host certificate. The certificate's public key must match a private host key already specified by HostKey. The default behaviour of sshd(8) is not to load any certificates.
π HostKey
specifies a file containing a private host key used by SSH. The defaults are /etc/gsissh/ssh_host_ecdsa_key, /etc/gsissh/ssh_host_ed25519_key and /etc/gsissh/ssh_host_rsa_key.
note thatsshd(8)will refuse to use a file if it is group/world-accessible, and that theHostKeyAlgorithmsoption restricts which of the keys are actually used bysshd(8). so like, keep your perms tight, bestie, fr fr π
It is possible to have multiple host key files. It is also possible to specify public host key files instead. In this case operations on the private key will be delegated to ssh-agent(1). π
HostKeyAgentβ this one points at the UNIX-domain socket you use to talk to an agent that has access to the private host keys. And if you set the string"SSH_AUTH_SOCK", then the location of the socket gets read from theSSH_AUTH_SOCKenvironment variable instead. β¨HostKeyAlgorithmsβ okay so the default here is handled system-wide bycrypto-policies(7). All the info about the defaults, how to modify them, and how to customize existing policies with sub-policies lives in the manual pageupdate-crypto-policies(8). π«Ά
It specifies the host key signature algorithms that the server offers. The default for this option is: β¦and then it just stops, bestie π no cap, the value isn't printed here. The list of available signature algorithms may also be obtained using "ssh -Q HostKeyAlgorithms".
HPNDisabledβ so in some situations, like transfers on a local area network, the impact of the HPN code produces a net decrease in performance π. In those cases it's helpful to disable the HPN functionality. By defaultHPNDisabledis set to β yep, again, the page just ends there π.IgnoreRhostsβ says whether to ignore per-user.rhostsand.shostsfiles duringHostbasedAuthentication. The system-wide/etc/hosts.equivand/etc/gsissh/shosts.equivare still used regardless of this setting, so don't think you're escaping them. π
Accepted values are yes (the default) to ignore all per-user files, shosts-only to allow the use of .shosts but to ignore .rhosts, or no to allow both .shosts and rhosts.
IgnoreUserKnownHostsβ says whethersshd(8)should ignore the user's~/.ssh/known_hostsduringHostbasedAuthenticationand use only the system-wide known hosts file/etc/gsissh/ssh_known_hosts. The default is βnoβ.Includeβ include the specified configuration file(s)! β¨ Multiple pathnames may be specified, and each pathname may containglob(7)wildcards that will be expanded and processed in lexical order. Files without absolute paths are assumed to be in/etc/ssh. And yes, anIncludedirective may appear inside aMatchblock to perform conditional inclusion. slay.IPQoSβ specifies the Differentiated Services Field Codepoint (DSCP) value for the connection. Accepted values areaf11,af12,af13,af21,af22,af23,af31,af32,af33,af41,af42,af43,cs0,cs1,cs2,cs3,cs4,cs5,cs6,cs7,ef,le, a numeric value, ornoneto use the operating system default.
This option may take one or two arguments, separated by whitespace. If one argument is specified, it is used as the packet class unconditionally. If two values are specified, the first is automatically selected for interactive sessions and the second for non-interactive sessions. The default is ef (Expedited Forwarding) for interactive sessions and none (the operating system default) for non-interactive sessions. π¦
KbdInteractiveAuthenticationβ says whether to allow keyboard-interactive authentication. All authentication styles fromlogin.conf(5)are supported. The default isyes. The argument to this keyword must beyesorno. Oh and heads up:ChallengeResponseAuthenticationis a deprecated alias for this. βKerberosAuthenticationβ says whether the password provided by the user forPasswordAuthenticationwill be validated through the Kerberos KDC. To use this option, the server needs a Kerberos servtab which allows the verification of the KDC's identity. The default isno.KerberosGetAFSTokenβ if AFS is active and the user has a Kerberos 5 TGT, attempt to acquire an AFS token before accessing the user's home directory. The default isno.KerberosOrLocalPasswdβ if password authentication through Kerberos fails, then the password will be validated via any additional local mechanism such as/etc/passwd. The default isyes. πKerberosTicketCleanupβ says whether to automatically destroy the user's ticket cache file on logout. The default isyes.KerberosUniqueCCacheβ says whether to store the acquired tickets in the per-session credential cache under/tmp/, or whether to use the per-user credential cache as configured in/etc/krb5.conf. Heads up bestie, the default valuenocan lead to overwriting previous tickets by subsequent connections to the same user account. πKerberosUseKuserokβ says whether to look at the.k5loginfile for user's aliases. The default isyes.KexAlgorithmsβ the default is handled system-wide bycrypto-policies(7). Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in the manual pageupdate-crypto-policies(8). π
Specifies the permitted KEX (Key Exchange) algorithms that the server will offer to clients. The ordering of this list is not important, because the client specifies the preference order. Multiple algorithms must be comma-separated.
If the specified list begins with a β+β character, then the specified methods will be appended to the built-in openssh default set instead of replacing them. If the specified list begins with a β-β character, then the specified algorithms (including wildcards) will be removed from the built-in openssh default set instead of replacing them. If the specified list begins with a β^β character, then the specified algorithms will be placed at the head of the built-in openssh default set.
The supported algorithms are:
curve25519-sha256
curve25519-sha256@libssh.org
diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group14-sha256
diffie-hellman-group16-sha512
diffie-hellman-group18-sha512
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
mlkem768x25519-sha256
sntrup761x25519-sha512
sntrup761x25519-sha512@openssh.com
The list of supported key exchange algorithms may also be obtained using "ssh -Q KexAlgorithms".
ListenAddressβ specifies the local addressessshd(8)should listen on. The following forms may be used:
ListenAddress hostname|address [rdomain domain]
ListenAddress hostname:port [rdomain domain]
ListenAddress IPv4_address:port [rdomain domain]
ListenAddress [hostname|address]:port [rdomain domain]
The optional rdomain qualifier requests sshd(8) listen in an explicit routing domain. If port is not specified, sshd will listen on the address and all Port options specified. The default is to listen on all local addresses on the current default routing domain. Multiple ListenAddress options are permitted. For more information on routing domains, see rdomain(4). π
LoginGraceTimeβ the server disconnects after this time if the user has not successfully logged in. If the value is0, there is no time limit. The default is120seconds. β³LogLevelβ gives the verbosity level that is used when logging messages fromsshd(8). The possible values are:QUIET,FATAL,ERROR,INFO,VERBOSE,DEBUG,DEBUG1,DEBUG2, andDEBUG3. The default isINFO.DEBUGandDEBUG1are equivalent.DEBUG2andDEBUG3each specify higher levels of debugging output.
okay so real talk: logging with a DEBUG level violates the privacy of users and is not recommended. π¬ keep that in mind.
LogVerboseβ specify one or more overrides toLogLevel. An override consists of one or more pattern lists that matches the source file, function and line number to force detailed logging for. For example, an override pattern of:
kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
would enable detailed logging for line 1000 of kex.c, everything in the kex_exchange_identification() function, and all code in the packet.c file. This option is intended for debugging and no overrides are enabled by default. π§
MACsβ the default is handled system-wide bycrypto-policies(7). Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in the manual pageupdate-crypto-policies(8). β¨
Specifies the available MAC (message authentication code) algorithms. The MAC algorithm is used for data integrity protection. Multiple algorithms must be comma-separated. If the specified list begins with a β+β character, then the specified algorithms will be appended to the built-in openssh default set instead of replacing them. If the specified list begins with a β-β character, then the specified algorithms (including wildcards) will be removed from the built-in openssh default set instead of replacing them. If the specified list begins with a β^β character, then the specified algorithms will be placed at the head of the built-in openssh default set.
The algorithms that contain "-etm" calculate the MAC after encryption (encrypt-then-mac). These are considered safer and their use recommended. π
The supported MACs are:
hmac-md5
hmac-md5-96
hmac-sha1
hmac-sha1-96
hmac-sha2-256
hmac-sha2-512
umac-64@openssh.com
umac-128@openssh.com
hmac-md5-etm@openssh.com
hmac-md5-96-etm@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-sha2-512-etm@openssh.com
umac-64-etm@openssh.com
umac-128-etm@openssh.com
The list of available MAC algorithms may also be obtained using "ssh -Q mac". π
Matchβ okay bestie, this one opens a conditional block π . If literally all the criteria on theMatchline are satisfied, then the keywords on the lines after it override whatever was set in the global section of the config file β and that stays true until either anotherMatchline shows up or you hit the end of the file. And listen: if the same keyword appears in multipleMatchblocks that are all satisfied, only the first instance of that keyword is applied. First come, first served, periodt. π
The arguments to Match are one or more criteria-pattern pairs, or one of the single token criteria: All, which matches all criteria (slay), or Invalid-User, which matches when the requested user-name does not match any known account. The available criteria are User, Group, Host, LocalAddress, LocalPort, Version, RDomain, and Address (with RDomain representing the rdomain(4) on which the connection was received).
The match patterns may consist of single entries or comma-separated lists, and they may use the wildcard and negation operators described in the βPATTERNSβ section of ssh_config(5). Go read that section if you need it, iykyk. π¦
The patterns in an Address criteria may additionally contain addresses to match in CIDR address/masklen format, such as 192.0.2.0/24 or 2001:db8::/32. Heads up though β the mask length you give has to be consistent with the address. It is an error to specify a mask length that is too long for the address, or one with bits set in the host portion of the address. Like, 192.0.2.0/33 and 192.0.2.0/8, respectively. Not those. π
The Version keyword matches against the version string of sshd(8), for example βOpenSSH_10.0β.
And no, you can't just slap any keyword after Match β only a subset is allowed. The available keywords are AcceptEnv, AllowAgentForwarding, AllowGroups, AllowStreamLocalForwarding, AllowTcpForwarding, AllowUsers, AuthenticationMethods, AuthorizedKeysCommand, AuthorizedKeysCommandUser, AuthorizedKeysFile, AuthorizedPrincipalsCommand, AuthorizedPrincipalsCommandUser, AuthorizedPrincipalsFile, Banner, CASignatureAlgorithms, ChannelTimeout, ChrootDirectory, ClientAliveCountMax, ClientAliveInterval, DenyGroups, DenyUsers, DisableForwarding, ExposeAuthInfo, ForceCommand, GatewayPorts, GSSAPIAuthentication, HostbasedAcceptedAlgorithms, HostbasedAuthentication, HostbasedUsesNameFromPacketOnly, IgnoreRhosts, Include, IPQoS, KbdInteractiveAuthentication, KerberosAuthentication, KerberosUseKuserok, LogLevel, MaxAuthTries, MaxSessions, PAMServiceName, PasswordAuthentication, PermitEmptyPasswords, PermitListen, PermitOpen, PermitRootLogin, PermitTTY, PermitTunnel, PermitUserRC, PubkeyAcceptedAlgorithms, PubkeyAuthentication, PubkeyAuthOptions, RefuseConnection, RekeyLimit, RevokedKeys, RDomain, SetEnv, StreamLocalBindMask, StreamLocalBindUnlink, TrustedUserCAKeys, UnusedConnectionTimeout, X11DisplayOffset, X11MaxDisplays, X11Forwarding and X11UseLocalhost. That's the whole guest list, no plus-ones. π
MaxAuthTriesβ the max number of authentication attempts allowed per connection. Once the number of failures reaches half this value, any additional failures get logged. Default is6.MaxSessionsβ the max number of open shell, login or subsystem (e.g.sftp) sessions permitted per network connection. Clients that support connection multiplexing can open multiple sessions. SettingMaxSessionsto1effectively disables session multiplexing, while setting it to0prevents all shell, login and subsystem sessions β but still lets forwarding happen. Default is10.MaxStartupsβ the max number of concurrent unauthenticated connections to the SSH daemon. Any additional connections get dropped until authentication succeeds or theLoginGraceTimeexpires for a connection. Default is10:30:100.
Alternatively, random early drop can be enabled by specifying the three colon separated values start:rate:full (e.g. "10:30:60"). sshd(8) will refuse connection attempts with a probability of rate/100 (30%) if there are currently start (10) unauthenticated connections. The probability increases linearly, and all connection attempts are refused once the number of unauthenticated connections reaches full (60).
ModuliFileβ themoduli(5)file holding the Diffie-Hellman groups used for theβdiffie-hellman-group-exchange-sha1βandβdiffie-hellman-group-exchange-sha256βkey exchange methods. Default is/etc/gsissh/moduli.NoneEnabledβ enable or disable the use of the None cipher. Care must always be used when enabling this, because it will allow users to send data in the clear. π However, it's important to note that authentication information remains encrypted even if this option is enabled. Default isno.NoneMacEnabledβ enable or disable the use of the None MAC. When this is enabled, ssh will *not* provide data integrity of any data being transmitted between hosts. Use with caution, because it β unlike just usingNoneEnabledβ doesn't provide data integrity and protection against man-in-the-middle attacks. As withNoneEnabled, all authentication remains encrypted and integrity is ensured. Default isno.PAMServiceNameβ the service name used for Pluggable Authentication Modules (PAM) authentication, authorisation and session controls whenUsePAMis enabled. Default issshd.PasswordAuthenticationβ whether password authentication is allowed. Default isyes.PermitEmptyPasswordsβ when password authentication is allowed, this says whether the server lets you log in to accounts with empty password strings. Default isno. (Please, bestie. Empty passwords are not the vibe. π«Ά)PermitListenβ the addresses/ports on which a remote TCP port forwarding may listen. The listen specification must be one of these forms:
PermitListen port
PermitListen host:port
Multiple permissions may be specified by separating them with whitespace. An argument of any removes all restrictions and permits any listen requests. An argument of none prohibits all listen requests. The host name may contain wildcards as described in the PATTERNS section in ssh_config(5). The wildcard β*β can also be used in place of a port number to allow all ports. By default, all port forwarding listen requests are permitted. Note that the GatewayPorts option may further restrict which addresses may be listened on. Note also that ssh(1) will request a listen host of βlocalhostβ if no listen host was specifically requested, and this name is treated differently to explicit localhost addresses of β127.0.0.1β and β::1β. Little detail, big consequences. β¨
PermitOpenβ the destinations to which TCP port forwarding is permitted. The forwarding specification must be one of these forms:
PermitOpen host:port
PermitOpen IPv4_addr:port
PermitOpen [IPv6_addr]:port
Multiple forwards may be specified by separating them with whitespace. An argument of any removes all restrictions and permits any forwarding requests. An argument of none prohibits all forwarding requests. The wildcard β*β can be used for host or port to allow all hosts or ports respectively. Otherwise, no pattern matching or address lookups are performed on supplied names. By default, all port forwarding requests are permitted.
PermitRootLoginβ whether root can log in usingssh(1). The argument must beyes,prohibit-password,forced-commands-only, orno. Default isprohibit-password.
If this option is set to prohibit-password (or its deprecated alias, without-password), password and keyboard-interactive authentication are disabled for root.
If this option is set to forced-commands-only, root login with public key authentication will be allowed β but only if the command option has been specified (which may be useful for taking remote backups even if root login is normally not allowed). All other authentication methods are disabled for root.
If this option is set to no, root is not allowed to log in. π«
PermitTTYβ whetherpty(4)allocation is permitted. Default isyes.PermitTunnelβ whethertun(4)device forwarding is allowed. The argument must beyes,point-to-point(layer 3),ethernet(layer 2), orno. Specifyingyespermits both point-to-point and ethernet. Default isno.
Independent of this setting, the permissions of the selected tun(4) device must allow access to the user. That part's on you. π§
PermitUserEnvironmentβ whether~/.ssh/environmentandenvironment=options in~/.ssh/authorized_keysare processed bysshd(8). Valid options areyes,noor a pattern-list specifying which environment variable names to accept (for example"LANG,LC_*"). Default isno. Enabling environment processing may enable users to bypass access restrictions in some configurations using mechanisms such asLD_PRELOAD. So like, be careful. πPermitUserRCβ whether any~/.ssh/rcfile is executed. Default isyes.PerSourceMaxStartupsβ the number of unauthenticated connections allowed from a given source address, orβnoneβif there is no limit. This limit is applied in addition toMaxStartups, whichever is lower. Default isnone.PerSourceNetBlockSizeβ the number of bits of source address that get grouped together for the purposes of applyingPerSourceMaxStartupslimits. Values for IPv4 and optionally IPv6 may be specified, separated by a colon. Default is32:128, which means each address is considered individually. πPerSourcePenaltiesβ bestie, this one is the β¨vibe policeβ¨ for people being sus tosshd(8). It controls the penalties for all those conditions that might be attacks. If a penalty gets enforced against a client, then its source address β plus all the other addresses in the same network, as defined byPerSourceNetBlockSizeβ gets refused connection for a whole period. Blocked, blocked, blocked. π«
Quick facts so you're not confused:
- A penalty does not affect concurrent connections already in progress. The way that it does stack though? Multiple penalties from the same source from concurrent connections will accumulate up to a maximum. And conversely, penalties aren't applied until a minimum threshold time has been accumulated. β³
- Penalties are enabled by default with the default settings listed below, but you can disable them with the
nokeyword. The defaults can be overridden by specifying one or more of the keywords below, separated by whitespace. All keywords accept arguments, e.g."crash:2m". π
Here are all the keywords, no cap:
crash:durationβ how long to refuse clients that cause a crash ofsshd(8)(default:90s). πauthfail:durationβ how long to refuse clients that disconnect after making one or more unsuccessful authentication attempts (default:5s).refuseconnection:durationβ how long to refuse clients that were administratively prohibited connection via theRefuseConnectionoption (default:10s).noauth:durationβ how long to refuse clients that disconnect without attempting authentication (default:1s). β οΈ Heads up: this timeout should be used cautiously, otherwise it may penalise legitimate scanning tools such asssh-keyscan(1). Not me accidentally banning the good guys πgrace-exceeded:durationβ how long to refuse clients that fail to authenticate afterLoginGraceTime(default:10s).max:durationβ the maximum time a particular source address range will be refused access for (default:10m). Repeated penalties will accumulate up to this maximum. πmin:durationβ the minimum penalty that must accrue before enforcement begins (default:15s).max-sources4:number,max-sources6:numberβ the maximum number of client IPv4 and IPv6 address ranges to track for penalties (default:65536for both). π€―overflow:modeβ controls how the server behaves whenmax-sources4ormax-sources6is exceeded. There are two operating modes:deny-all, which denies all incoming connections other than those exempted viaPerSourcePenaltyExemptListuntil a penalty expires, andpermissive, which allows new connections by removing existing penalties early (default:permissive). Note that client penalties below theminthreshold count against the total number of tracked penalties. IPv4 and IPv6 addresses are tracked separately, so an overflow in one will not affect the other. πoverflow6:modeβ lets you specify a different overflow mode for IPv6 addresses. The default is to use the same overflow mode as was specified for IPv4.
PerSourcePenaltyExemptListβ the VIP list π, a comma-separated list of addresses to exempt from penalties. This list may contain wildcards and CIDR address/masklen ranges. Note that the mask length provided must be consistent with the address β it is an error to specify a mask length that is too long for the address or one with bits set in this host portion of the address. For example,192.0.2.0/33and192.0.2.0/8, respectively. The default is not to exempt any addresses.PidFileβ specifies the file that contains the process ID of the SSH daemon, ornoneto not write one. The default is/var/run/gsisshd.pid. πPortβ specifies the port number thatsshd(8)listens on. The default is22. Multiple options of this type are permitted. See alsoListenAddress. πPrintLastLogβ specifies whethersshd(8)should print the date and time of the last user login when a user logs in interactively. The default isyes. π°οΈPrintMotdβ specifies whethersshd(8)should print/etc/motdwhen a user logs in interactively. (On some systems it is also printed by the shell,/etc/profile, or equivalent.) The default isyes. π’PubkeyAcceptedAlgorithmsβ okay so the default here is handled system-wide bycrypto-policies(7). Info about defaults, how to modify the defaults and how to customize existing policies with sub-policies lives in manual pageupdate-crypto-policies(8). π§
It specifies the signature algorithms that will be accepted for public key authentication as a list of comma-separated patterns. And here's the cute prefix magic β¨:
- If the specified list begins with a
β+βcharacter, then the specified algorithms will be appended to the built-in openssh default set instead of replacing them. - If the specified list begins with a
β-βcharacter, then the specified algorithms (including wildcards) will be removed from the built-in openssh default set instead of replacing them. - If the specified list begins with a
β^βcharacter, then the specified algorithms will be placed at the head of the built-in openssh default set.
The list of available signature algorithms may also be obtained using "ssh -Q PubkeyAcceptedAlgorithms". π
PubkeyAuthOptionsβ sets one or more public key authentication options. The supported keywords are:none(the default; indicating no additional options are enabled),touch-requiredandverify-required. π- The
touch-requiredoption causes public key authentication using a FIDO authenticator algorithm (i.e.ecdsa-skored25519-sk) to always require the signature to attest that a physically present user explicitly confirmed the authentication (usually by touching the authenticator). By default,sshd(8)requires user presence unless overridden with anauthorized_keysoption. Thetouch-requiredflag disables this override. π - The
verify-requiredoption requires a FIDO key signature attest that the user was verified, e.g. via a PIN. π’ - Neither the
touch-requiredorverify-requiredoptions have any effect for other, non-FIDO, public key types. Periodt.
- The
PubkeyAuthenticationβ specifies whether public key authentication is allowed. The default isyes. ποΈRefuseConnectionβ indicates thatsshd(8)should unconditionally terminate the connection. Additionally, arefuseconnectionpenalty may be recorded against the source of the connection ifPerSourcePenaltiesare enabled. This option is only really useful in aMatchblock. πRekeyLimitβ specifies the maximum amount of data that may be transmitted or received before the session key is renegotiated, optionally followed by a maximum amount of time that may pass before the session key is renegotiated. The first argument is specified in bytes and may have a suffix ofβKβ,βMβ, orβGβto indicate Kilobytes, Megabytes, or Gigabytes, respectively. The default is betweenβ1Gβandβ4Gβ, depending on the cipher. The optional second value is specified in seconds and may use any of the units documented in the βTIME FORMATSβ section. The default value forRekeyLimitisdefault none, which means that rekeying is performed after the cipher's default amount of data has been sent or received and no time based rekeying is done. πRequiredRSASizeβ specifies the minimum RSA key size (in bits) thatsshd(8)will accept. User and host-based authentication keys smaller than this limit will be refused. The default is1024bits. Note that this limit may only be raised from the default. πRevokedKeysβ specifies revoked public keys file, ornoneto not use one. Keys listed in this file will be refused for public key authentication. β οΈ Note that if this file is not readable, then public key authentication will be refused for all users. Keys may be specified as a text file, listing one public key per line, or as an OpenSSH Key Revocation List (KRL) as generated byssh-keygen(1). For more information on KRLs, see the KEY REVOCATION LISTS section inssh-keygen(1).RDomainβ specifies an explicit routing domain that is applied after authentication has completed. The user session, as well as any forwarded or listening IP sockets, will be bound to thisrdomain(4). If the routing domain is set to%D, then the domain in which the incoming connection was received will be applied. πSecurityKeyProviderβ specifies a path to a library that will be used when loading FIDO authenticator-hosted keys, overriding the default of using the built-in USB HID support. π¦SetEnvβ specifies one or more environment variables to set in child sessions started bysshd(8)asβNAME=VALUEβ. The environment value may be quoted (e.g. if it contains whitespace characters). Environment variables set bySetEnvoverride the default environment and any variables specified by the user viaAcceptEnvorPermitUserEnvironment. πSshdAuthPathβ overrides the default path to thesshd-authbinary that is invoked to complete user authentication. The default is/usr/libexec/gsissh/sshd-auth. This option is intended for use by tests. π§ͺSshdSessionPathβ overrides the default path to thesshd-sessionbinary that is invoked to handle each connection. The default is/usr/libexec/gsissh/sshd-session. This option is intended for use by tests. π§ͺStreamLocalBindMaskβ sets the octal file creation mode mask (umask) used when creating a Unix-domain socket file for local or remote port forwarding. This option is only used for port forwarding to a Unix-domain socket file. π§¦
The default value is 0177, which creates a Unix-domain socket file that's readable and writable only by the owner. π
Note that not all operating systems honor the file mode on Unix-domain socket files, so like, don't @ me if your OS is quirky. π«Ά
StreamLocalBindUnlinkβ Okay so this one specifies whether to remove an existing Unix-domain socket file for local or remote port forwarding before creating a new one. If the socket file already exists andStreamLocalBindUnlinkis not enabled,sshdwill be unable to forward the port to the Unix-domain socket file. This option is only used for port forwarding to a Unix-domain socket file. The argument must beyesorno. The default isno. No cap.StrictModesβ Specifies whethersshd(8)should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default isyes. Note that this does not apply toChrootDirectory, whose permissions and ownership are checked unconditionally. It's giving security bestie. πSubsystemβ Configures an external subsystem (e.g. file transfer daemon). Arguments should be a subsystem name and a command (with optional arguments) to execute upon subsystem request. The commandsftp-serverimplements the SFTP file transfer subsystem. Alternately the nameinternal-sftpimplements an in-process SFTP server. This may simplify configurations usingChrootDirectoryto force a different filesystem root on clients. It accepts the same command line arguments assftp-serverand even though it is in-process, settings such asLogLevelorSyslogFacilitydo not apply to it and must be set explicitly via command line arguments. By default no subsystems are defined. Periodt.SyslogFacilityβ Gives the facility code that is used when logging messages fromsshd(8). The possible values are:DAEMON,USER,AUTH,AUTHPRIV,LOCAL0,LOCAL1,LOCAL2,LOCAL3,LOCAL4,LOCAL5,LOCAL6,LOCAL7. The default isAUTH. Iconic logging vibes.TCPKeepAliveβ Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying. On the other hand, if TCP keepalives are not sent, sessions may hang indefinitely on the server, leaving "ghost" users and consuming server resources. The default isyes(to send TCP keepalive messages), and the server will notice if the network goes down or the client host crashes. This avoids infinitely hanging sessions. To disable TCP keepalive messages, the value should be set tono. Enable or disable the polling of the tcp receive buffer throughout the life of the connection. Make sure that this option is enabled for systems making use of autotuning kernels (linux 2.4.24+,2.6,MS Vista) in order to maximize throughput on high performance networks. Default isyes. Lowkey important, highkey useful. π₯TrustedUserCAKeysβ Specifies a file containing public keys of certificate authorities that are trusted to sign user certificates for authentication, ornoneto not use one. Keys are listed one per line; empty lines and comments starting with#are allowed. If a certificate is presented for authentication and has its signing CA key listed in this file, then it may be used for authentication for any user listed in the certificate's principals list. Note that certificates that lack a list of principals will not be permitted for authentication usingTrustedUserCAKeys. For more details on certificates, see theCERTIFICATESsection inssh-keygen(1). The way this works is giving main character energy. πUnusedConnectionTimeoutβ Specifies whether and how quicklysshd(8)should close client connections with no open channels. Open channels include active shell, command execution or subsystem sessions, connected network, socket, agent or X11 forwardings. Forwarding listeners, such as those from thessh(1)-Rflag, are not considered as open channels and do not prevent the timeout. The timeout value is specified in seconds or may use any of the units documented in the βTIME FORMATSβ section. Note that this timeout starts when the client connection completes user authentication but before the client has an opportunity to open any channels. Caution should be used when using short timeout values, as they may not provide sufficient time for the client to request and open its channels before terminating the connection. The defaultnoneis to never expire connections for having no open channels. This option may be useful in conjunction withChannelTimeout. Don't be caught slacking. π«ΆUseDNSβ Specifies whethersshd(8)should look up the remote host name, and to check that the resolved host name for the remote IP address maps back to the very same IP address. If this option is set tono(the default) then only addresses and not host names may be used in~/.ssh/authorized_keysfrom andsshd_configMatch Hostdirectives. Fr fr.UseMPTCPβ If set toyes, this will enable Multipath TCP (MPTCP) instead of TCP (this only works on Linux). The default isno. Linux girlies only. π§UsePAMβ Enables the Pluggable Authentication Module interface. If set toyesthis will enable PAM authentication usingKbdInteractiveAuthenticationandPasswordAuthenticationin addition to PAM account and session module processing for all authentication types. Because PAM keyboard-interactive authentication usually serves an equivalent role to password authentication, you should disable eitherPasswordAuthenticationorKbdInteractiveAuthentication. IfUsePAMis enabled, you will not be able to runsshd(8)as a non-root user. The default isno. The way that PAM works is wild. πPermitPAMUserChangeβ If set toyesthis will enable PAM authentication to change the name of the user being authenticated. The default isno. Not me changing users mid-auth. πVersionAddendumβ Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default isnone. Cute little banner extra. πX11DisplayOffsetβ Specifies the first display number available forsshd(8)'s X11 forwarding. This preventssshdfrom interfering with real X11 servers. The default is10. Slay.X11MaxDisplaysβ Specifies the maximum number of displays available forsshd(8)'s X11 forwarding. This preventssshdfrom exhausting local ports. The default is1000. Iconic.X11Forwardingβ Specifies whether X11 forwarding is permitted. The argument must beyesorno. The default isno. When X11 forwarding is enabled, there may be additional exposure to the server and to client displays if thesshd(8)proxy display is configured to listen on the wildcard address (seeX11UseLocalhost), though this is not the default. Additionally, the authentication spoofing and authentication data verification and substitution occur on the client side. The security risk of using X11 forwarding is that the client's X11 display server may be exposed to attack when the SSH client requests forwarding (see the warnings forForwardX11inssh_config(5)). A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant anosetting. Note that disabling X11 forwarding does not prevent users from forwarding X11 traffic, as users can always install their own forwarders. Security risk? It's giving yikes. πX11UseLocalhostβ Specifies whethersshd(8)should bind the X11 forwarding server to the loopback address or to the wildcard address. By default,sshdbinds the forwarding server to the loopback address and sets the hostname part of theDISPLAYenvironment variable tolocalhost. This prevents remote hosts from connecting to the proxy display. However, some older X11 clients may not function with this configuration.X11UseLocalhostmay be set tonoto specify that the forwarding server should be bound to the wildcard address. The argument must beyesorno. The default isyes. Bestie, keep it loopback. β¨XAuthLocationβ Specifies the full pathname of thexauth(1)program, ornoneto not use one. The default is/usr/bin/xauth. The way that path is giving. π
β° TIME FORMATS β°
sshd(8) command-line arguments and configuration file options that specify time may be expressed using a sequence of the form: time[qualifier], where time is a positive integer value and qualifier is one of the following:
β¨noneβ©β secondss | Sβ secondsm | Mβ minutesh | Hβ hoursd | Dβ daysw | Wβ weeks
Each member of the sequence is added together to calculate the total time value.
Time format examples:
600 600 seconds (10 minutes)
10m 10 minutes
1h30m 1 hour 30 minutes (90 minutes)
β¨ TOKENS β¨
okay bestie so some keywords? they don't just take boring static values β they take tokens, which get expanded at runtime. it's giving β¨magic variablesβ¨. here's the whole squad:
%%β a literal%. yes that's it. that's the whole token. she's simple, she's iconic π%Cβ identifies the connection endpoints. four space-separated values, in this exact order: client address, client port number, server address, server port number π«Ά%Dβ the routing domain in which the incoming connection was received%Fβ the fingerprint of the CA key π%fβ the fingerprint of the key or certificate%hβ the home directory of the user π%iβ the key ID in the certificate%Kβ the base64-encoded CA key%kβ the base64-encoded key or certificate for authentication%sβ the serial number of the certificate%Tβ the type of the CA key%tβ the key or certificate type%Uβ the numeric user ID of the target user%uβ the username
now here's the important part bestie β not every keyword accepts every token. each one has its own lil guest list and if a token isn't invited it is NOT coming in. no cap. here's who gets who:
AuthorizedKeysCommand accepts the tokens %%, %C, %D, %f, %h, %k, %t, %U, and %u.
AuthorizedKeysFile accepts the tokens %%, %h, %U, and %u.
AuthorizedPrincipalsCommand accepts the tokens %%, %C, %D, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u. (yeah she's the popular one, she got the whole roster π)
AuthorizedPrincipalsFile accepts the tokens %%, %h, %U, and %u.
ChrootDirectory accepts the tokens %%, %h, %U, and %u.
RoutingDomain accepts the token %D.
π FILES π
/etc/gsissh/sshd_configβ contains configuration data forsshd(8). this file should be writable by root only π (like, do not let anyone else touch it, fr fr), but it's recommended β though not necessary β that it be world-readable. so: root writes, everyone else can peek. cute, right? π
π¦ SEE ALSO π¦
go read those next, bestie, i'm literally begging π«Ά
π AUTHORS π
okay history lesson time, and honestly? this part is kind of a slay.
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. then Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. β¨
Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support for privilege separation. and Chris Rapier, Michael Stevens, Ben Bennet, and Mike Tasota developed the HPN extensions at the Pittsburgh Supercomuting Center with grants from Cisco, the National Library of Medicine, and the National Science Foundation. π
absolute legends, every single one of them. we stan a maintainer π
and that's the whole page, babe!! you made it to the end, i'm so proud of you fr fr ππ
this lil beauty comes to you from Debian, dated October 4, 2025, and she lives under the name SSHD_CONFIG(5) π
now go forth and configure your sshd responsibly. mwah π β¨
π¦ where this page comes from
- fedora 44: gsi-openssh-server 10.2p1-4.fc44 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
- 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms