{
    "mode": "man",
    "parameter": "authorized_keys",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/authorized_keys/5/json",
    "generated": "2026-06-15T14:41:27Z",
    "synopsis": "sshd [-46DdeiqTt] [-C connectionspec] [-c hostcertificatefile] [-E logfile]\n[-f configfile] [-g logingracetime] [-h hostkeyfile] [-o option] [-p port] [-u len]",
    "sections": {
        "NAME": {
            "content": "sshd — OpenSSH daemon\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sshd [-46DdeiqTt] [-C connectionspec] [-c hostcertificatefile] [-E logfile]\n[-f configfile] [-g logingracetime] [-h hostkeyfile] [-o option] [-p port] [-u len]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "sshd (OpenSSH Daemon) is the daemon program for ssh(1).  It provides secure encrypted communi‐\ncations between two untrusted hosts over an insecure network.\n\nsshd listens for connections from clients.  It is normally started at boot from\n/etc/init.d/ssh.  It forks a new daemon for each incoming connection.  The forked daemons han‐\ndle key exchange, encryption, authentication, command execution, and data exchange.\n\nsshd can be configured using command-line options or a configuration file (by default\nsshdconfig(5)); command-line options override values specified in the configuration file.\nsshd rereads its configuration file when it receives a hangup signal, SIGHUP, by executing it‐\nself with the name and options it was started with, e.g. /usr/sbin/sshd.\n\nThe options are as follows:\n",
            "subsections": [
                {
                    "name": "-4",
                    "content": "",
                    "flag": "-4"
                },
                {
                    "name": "-6",
                    "content": "",
                    "flag": "-6"
                },
                {
                    "name": "-C",
                    "content": "Specify the connection parameters to use for the -T extended test mode.  If provided,\nany Match directives in the configuration file that would apply are applied before the\nconfiguration is written to standard output.  The connection parameters are supplied as\nkeyword=value pairs and may be supplied in any order, either with multiple -C options\nor as a comma-separated list.  The keywords are “addr”, “user”, “host”, “laddr”,\n“lport”, and “rdomain” and correspond to source address, user, resolved source host\nname, local address, local port number and routing domain respectively.\n",
                    "flag": "-C"
                },
                {
                    "name": "-c",
                    "content": "Specifies a path to a certificate file to identify sshd during key exchange.  The cer‐\ntificate file must match a host key file specified using the -h option or the HostKey\nconfiguration directive.\n",
                    "flag": "-c"
                },
                {
                    "name": "-D",
                    "content": "allows easy monitoring of sshd.\n",
                    "flag": "-D"
                },
                {
                    "name": "-d",
                    "content": "itself in the background.  The server also will not fork(2) and will only process one\nconnection.  This option is only intended for debugging for the server.  Multiple -d\noptions increase the debugging level.  Maximum is 3.\n",
                    "flag": "-d"
                },
                {
                    "name": "-E",
                    "content": "Append debug logs to logfile instead of the system log.\n",
                    "flag": "-E"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-f",
                    "content": "Specifies the name of the configuration file.  The default is /etc/ssh/sshdconfig.\nsshd refuses to start if there is no configuration file.\n",
                    "flag": "-f"
                },
                {
                    "name": "-g",
                    "content": "Gives the grace time for clients to authenticate themselves (default 120 seconds).  If\nthe client fails to authenticate the user within this many seconds, the server discon‐\nnects and exits.  A value of zero indicates no limit.\n",
                    "flag": "-g"
                },
                {
                    "name": "-h",
                    "content": "Specifies a file from which a host key is read.  This option must be given if sshd is\nnot run as root (as the normal host key files are normally not readable by anyone but\nroot).  The default is /etc/ssh/sshhostecdsakey, /etc/ssh/sshhosted25519key and\n/etc/ssh/sshhostrsakey.  It is possible to have multiple host key files for the dif‐\nferent host key algorithms.\n",
                    "flag": "-h"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-o",
                    "content": "Can be used to give options in the format used in the configuration file.  This is use‐\nful for specifying options for which there is no separate command-line flag.  For full\ndetails of the options, and their values, see sshdconfig(5).\n",
                    "flag": "-o"
                },
                {
                    "name": "-p",
                    "content": "Specifies the port on which the server listens for connections (default 22).  Multiple\nport options are permitted.  Ports specified in the configuration file with the Port\noption are ignored when a command-line port is specified.  Ports specified using the\nListenAddress option override command-line ports.\n",
                    "flag": "-p"
                },
                {
                    "name": "-q",
                    "content": "tion, and termination of each connection is logged.\n",
                    "flag": "-q"
                },
                {
                    "name": "-T",
                    "content": "configuration to stdout and then exit.  Optionally, Match rules may be applied by spec‐\nifying the connection parameters using one or more -C options.\n",
                    "flag": "-T"
                },
                {
                    "name": "-t",
                    "content": "This is useful for updating sshd reliably as configuration options may change.\n",
                    "flag": "-t"
                },
                {
                    "name": "-u",
                    "content": "the remote host name.  If the resolved host name is longer than len, the dotted decimal\nvalue will be used instead.  This allows hosts with very long host names that overflow\nthis field to still be uniquely identified.  Specifying -u0 indicates that only dotted\ndecimal addresses should be put into the utmp file.  -u0 may also be used to prevent\nsshd from making DNS requests unless the authentication mechanism or configuration re‐\nquires it.  Authentication mechanisms that may require DNS include\nHostbasedAuthentication and using a from=\"pattern-list\" option in a key file.  Configu‐\nration options that require DNS include using a USER@HOST pattern in AllowUsers or\nDenyUsers.\n",
                    "flag": "-u"
                }
            ]
        },
        "AUTHENTICATION": {
            "content": "The OpenSSH SSH daemon supports SSH protocol 2 only.  Each host has a host-specific key, used\nto identify the host.  Whenever a client connects, the daemon responds with its public host\nkey.  The client compares the host key against its own database to verify that it has not\nchanged.  Forward secrecy is provided through a Diffie-Hellman key agreement.  This key agree‐\nment results in a shared session key.  The rest of the session is encrypted using a symmetric\ncipher.  The client selects the encryption algorithm to use from those offered by the server.\nAdditionally, session integrity is provided through a cryptographic message authentication code\n(MAC).\n\nFinally, the server and the client enter an authentication dialog.  The client tries to authen‐\nticate itself using host-based authentication, public key authentication, challenge-response\nauthentication, or password authentication.\n\nRegardless of the authentication type, the account is checked to ensure that it is accessible.\nAn account is not accessible if it is locked, listed in DenyUsers or its group is listed in\nDenyGroups .  The definition of a locked account is system dependent. Some platforms have their\nown account database (eg AIX) and some modify the passwd field ( ‘*LK*’ on Solaris and\nUnixWare, ‘*’ on HP-UX, containing ‘Nologin’ on Tru64, a leading ‘*LOCKED*’ on FreeBSD and a\nleading ‘!’ on most Linuxes).  If there is a requirement to disable password authentication for\nthe account while allowing still public-key, then the passwd field should be set to something\nother than these values (eg ‘NP’ or ‘*NP*’ ).\n\nIf the client successfully authenticates itself, a dialog for preparing the session is entered.\nAt this time the client may request things like allocating a pseudo-tty, forwarding X11 connec‐\ntions, forwarding TCP connections, or forwarding the authentication agent connection over the\nsecure channel.\n\nAfter this, the client either requests an interactive shell or execution or a non-interactive\ncommand, which sshd will execute via the user's shell using its -c option.  The sides then en‐\nter session mode.  In this mode, either side may send data at any time, and such data is for‐\nwarded to/from the shell or command on the server side, and the user terminal in the client\nside.\n\nWhen the user program terminates and all forwarded X11 and other connections have been closed,\nthe server sends command exit status to the client, and both sides exit.\n",
            "subsections": []
        },
        "LOGIN PROCESS": {
            "content": "When a user successfully logs in, sshd does the following:\n\n1.   If the login is on a tty, and no command has been specified, prints last login time\nand /etc/motd (unless prevented in the configuration file or by ~/.hushlogin; see\nthe FILES section).\n\n2.   If the login is on a tty, records login time.\n\n3.   Checks /etc/nologin; if it exists, prints contents and quits (unless root).\n\n4.   Changes to run with normal user privileges.\n\n5.   Sets up basic environment.\n\n6.   Reads the file ~/.ssh/environment, if it exists, and users are allowed to change\ntheir environment.  See the PermitUserEnvironment option in sshdconfig(5).\n\n7.   Changes to user's home directory.\n\n8.   If ~/.ssh/rc exists and the sshdconfig(5) PermitUserRC option is set, runs it; else\nif /etc/ssh/sshrc exists, runs it; otherwise runs xauth(1).  The “rc” files are\ngiven the X11 authentication protocol and cookie in standard input.  See SSHRC, be‐\nlow.\n\n9.   Runs user's shell or command.  All commands are run under the user's login shell as\nspecified in the system password database.\n",
            "subsections": []
        },
        "SSHRC": {
            "content": "If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment files but before\nstarting the user's shell or command.  It must not produce any output on stdout; stderr must be\nused instead.  If X11 forwarding is in use, it will receive the \"proto cookie\" pair in its\nstandard input (and DISPLAY in its environment).  The script must call xauth(1) because sshd\nwill not run xauth automatically to add X11 cookies.\n\nThe primary purpose of this file is to run any initialization routines which may be needed be‐\nfore the user's home directory becomes accessible; AFS is a particular example of such an envi‐\nronment.\n\nThis file will probably contain some initialization code followed by something similar to:\n\nif read proto cookie && [ -n \"$DISPLAY\" ]; then\nif [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then\n# X11UseLocalhost=yes\necho add unix:`echo $DISPLAY |\ncut -c11-` $proto $cookie\nelse\n# X11UseLocalhost=no\necho add $DISPLAY $proto $cookie\nfi | xauth -q -\nfi\n\nIf this file does not exist, /etc/ssh/sshrc is run, and if that does not exist either, xauth is\nused to add the cookie.\n",
            "subsections": []
        },
        "AUTHORIZEDKEYS FILE FORMAT": {
            "content": "AuthorizedKeysFile specifies the files containing public keys for public key authentication; if\nthis option is not specified, the default is ~/.ssh/authorizedkeys and\n~/.ssh/authorizedkeys2.  Each line of the file contains one key (empty lines and lines start‐\ning with a ‘#’ are ignored as comments).  Public keys consist of the following space-separated\nfields: options, keytype, base64-encoded key, comment.  The options field is optional.  The\nsupported key types are:\n\nsk-ecdsa-sha2-nistp256@openssh.com\necdsa-sha2-nistp256\necdsa-sha2-nistp384\necdsa-sha2-nistp521\nsk-ssh-ed25519@openssh.com\nssh-ed25519\nssh-dss\nssh-rsa\n\nThe comment field is not used for anything (but may be convenient for the user to identify the\nkey).\n\nNote that lines in this file can be several hundred bytes long (because of the size of the pub‐\nlic key encoding) up to a limit of 8 kilobytes, which permits RSA keys up to 16 kilobits.  You\ndon't want to type them in; instead, copy the iddsa.pub, idecdsa.pub, idecdsask.pub,\nided25519.pub, ided25519sk.pub, or the idrsa.pub file and edit it.\n\nsshd enforces a minimum RSA key modulus size of 1024 bits.\n\nThe options (if present) consist of comma-separated option specifications.  No spaces are per‐\nmitted, except within double quotes.  The following option specifications are supported (note\nthat option keywords are case-insensitive):\n",
            "subsections": [
                {
                    "name": "agent-forwarding",
                    "content": "Enable authentication agent forwarding previously disabled by the restrict option.\n"
                },
                {
                    "name": "cert-authority",
                    "content": "Specifies that the listed key is a certification authority (CA) that is trusted to val‐\nidate signed certificates for user authentication.\n\nCertificates may encode access restrictions similar to these key options.  If both cer‐\ntificate restrictions and key options are present, the most restrictive union of the\ntwo is applied.\n"
                },
                {
                    "name": "command=\"command\"",
                    "content": "Specifies that the command is executed whenever this key is used for authentication.\nThe command supplied by the user (if any) is ignored.  The command is run on a pty if\nthe client requests a pty; otherwise it is run without a tty.  If an 8-bit clean chan‐\nnel is required, one must not request a pty or should specify no-pty.  A quote may be\nincluded in the command by quoting it with a backslash.\n\nThis option might be useful to restrict certain public keys to perform just a specific\noperation.  An example might be a key that permits remote backups but nothing else.\nNote that the client may specify TCP and/or X11 forwarding unless they are explicitly\nprohibited, e.g. using the restrict key option.\n\nThe command originally supplied by the client is available in the SSHORIGINALCOMMAND\nenvironment variable.  Note that this option applies to shell, command or subsystem ex‐\necution.  Also note that this command may be superseded by a sshdconfig(5)\nForceCommand directive.\n\nIf a command is specified and a forced-command is embedded in a certificate used for\nauthentication, then the certificate will be accepted only if the two commands are\nidentical.\n"
                },
                {
                    "name": "environment=\"NAME=value\"",
                    "content": "Specifies that the string is to be added to the environment when logging in using this\nkey.  Environment variables set this way override other default environment values.\nMultiple options of this type are permitted.  Environment processing is disabled by de‐\nfault and is controlled via the PermitUserEnvironment option.\n"
                },
                {
                    "name": "expiry-time=\"timespec\"",
                    "content": "Specifies a time after which the key will not be accepted.  The time may be specified\nas a YYYYMMDD date or a YYYYMMDDHHMM[SS] time in the system time-zone.\n"
                },
                {
                    "name": "from=\"pattern-list\"",
                    "content": "Specifies that in addition to public key authentication, either the canonical name of\nthe remote host or its IP address must be present in the comma-separated list of pat‐\nterns.  See PATTERNS in sshconfig(5) for more information on patterns.\n\nIn addition to the wildcard matching that may be applied to hostnames or addresses, a\nfrom stanza may match IP addresses using CIDR address/masklen notation.\n\nThe purpose of this option is to optionally increase security: public key authentica‐\ntion by itself does not trust the network or name servers or anything (but the key);\nhowever, if somebody somehow steals the key, the key permits an intruder to log in from\nanywhere in the world.  This additional option makes using a stolen key more difficult\n(name servers and/or routers would have to be compromised in addition to just the key).\n"
                },
                {
                    "name": "no-agent-forwarding",
                    "content": "Forbids authentication agent forwarding when this key is used for authentication.\n"
                },
                {
                    "name": "no-port-forwarding",
                    "content": "Forbids TCP forwarding when this key is used for authentication.  Any port forward re‐\nquests by the client will return an error.  This might be used, e.g. in connection with\nthe command option.\n\nno-pty  Prevents tty allocation (a request to allocate a pty will fail).\n"
                },
                {
                    "name": "no-user-rc",
                    "content": "Disables execution of ~/.ssh/rc.\n"
                },
                {
                    "name": "no-X11-forwarding",
                    "content": "Forbids X11 forwarding when this key is used for authentication.  Any X11 forward re‐\nquests by the client will return an error.\n"
                },
                {
                    "name": "permitlisten=\"[host:]port\"",
                    "content": "Limit remote port forwarding with the ssh(1) -R option such that it may only listen on\nthe specified host (optional) and port.  IPv6 addresses can be specified by enclosing\nthe address in square brackets.  Multiple permitlisten options may be applied separated\nby commas.  Hostnames may include wildcards as described in the PATTERNS section in\nsshconfig(5).  A port specification of * matches any port.  Note that the setting of\nGatewayPorts may further restrict listen addresses.  Note that ssh(1) will send a host‐\nname of “localhost” if a listen host was not specified when the forwarding was re‐\nquested, and that this name is treated differently to the explicit localhost addresses\n“127.0.0.1” and “::1”.\n"
                },
                {
                    "name": "permitopen=\"host:port\"",
                    "content": "Limit local port forwarding with the ssh(1) -L option such that it may only connect to\nthe specified host and port.  IPv6 addresses can be specified by enclosing the address\nin square brackets.  Multiple permitopen options may be applied separated by commas.\nNo pattern matching or name lookup is performed on the specified hostnames, they must\nbe literal host names and/or addresses.  A port specification of * matches any port.\n"
                },
                {
                    "name": "port-forwarding",
                    "content": "Enable port forwarding previously disabled by the restrict option.\n"
                },
                {
                    "name": "principals=\"principals\"",
                    "content": "On a cert-authority line, specifies allowed principals for certificate authentication\nas a comma-separated list.  At least one name from the list must appear in the certifi‐\ncate's list of principals for the certificate to be accepted.  This option is ignored\nfor keys that are not marked as trusted certificate signers using the cert-authority\noption.\n\npty     Permits tty allocation previously disabled by the restrict option.\n"
                },
                {
                    "name": "no-touch-required",
                    "content": "Do not require demonstration of user presence for signatures made using this key.  This\noption only makes sense for the FIDO authenticator algorithms ecdsa-sk and ed25519-sk.\n"
                },
                {
                    "name": "verify-required",
                    "content": "Require that signatures made using this key attest that they verified the user, e.g.\nvia a PIN.  This option only makes sense for the FIDO authenticator algorithms ecdsa-sk\nand ed25519-sk.\n"
                },
                {
                    "name": "restrict",
                    "content": "Enable all restrictions, i.e. disable port, agent and X11 forwarding, as well as dis‐\nabling PTY allocation and execution of ~/.ssh/rc.  If any future restriction capabili‐\nties are added to authorizedkeys files they will be included in this set.\n"
                },
                {
                    "name": "tunnel=\"n\"",
                    "content": "Force a tun(4) device on the server.  Without this option, the next available device\nwill be used if the client requests a tunnel.\n"
                },
                {
                    "name": "user-rc",
                    "content": "Enables execution of ~/.ssh/rc previously disabled by the restrict option.\n"
                },
                {
                    "name": "X11-forwarding",
                    "content": "Permits X11 forwarding previously disabled by the restrict option.\n\nAn example authorizedkeys file:\n\n# Comments are allowed at start of line. Blank lines are allowed.\n# Plain key, no restrictions\nssh-rsa ...\n# Forced command, disable PTY and all forwarding\nrestrict,command=\"dump /home\" ssh-rsa ...\n# Restriction of ssh -L forwarding destinations\npermitopen=\"192.0.2.1:80\",permitopen=\"192.0.2.2:25\" ssh-rsa ...\n# Restriction of ssh -R forwarding listeners\npermitlisten=\"localhost:8080\",permitlisten=\"[::1]:22000\" ssh-rsa ...\n# Configuration for tunnel forwarding\ntunnel=\"0\",command=\"sh /etc/netstart tun0\" ssh-rsa ...\n# Override of restriction to allow PTY allocation\nrestrict,pty,command=\"nethack\" ssh-rsa ...\n# Allow FIDO key without requiring touch\nno-touch-required sk-ecdsa-sha2-nistp256@openssh.com ...\n# Require user-verification (e.g. PIN or biometric) for FIDO key\nverify-required sk-ecdsa-sha2-nistp256@openssh.com ...\n# Trust CA key, allow touch-less FIDO if requested in certificate\ncert-authority,no-touch-required,principals=\"usera\" ssh-rsa ...\n"
                }
            ]
        },
        "SSHKNOWNHOSTS FILE FORMAT": {
            "content": "The /etc/ssh/sshknownhosts and ~/.ssh/knownhosts files contain host public keys for all\nknown hosts.  The global file should be prepared by the administrator (optional), and the per-\nuser file is maintained automatically: whenever the user connects to an unknown host, its key\nis added to the per-user file.\n\nEach line in these files contains the following fields: marker (optional), hostnames, keytype,\nbase64-encoded key, comment.  The fields are separated by spaces.\n\nThe marker is optional, but if it is present then it must be one of “@cert-authority”, to indi‐\ncate that the line contains a certification authority (CA) key, or “@revoked”, to indicate that\nthe key contained on the line is revoked and must not ever be accepted.  Only one marker should\nbe used on a key line.\n\nHostnames is a comma-separated list of patterns (‘*’ and ‘?’ act as wildcards); each pattern in\nturn is matched against the host name.  When sshd is authenticating a client, such as when us‐\ning HostbasedAuthentication, this will be the canonical client host name.  When ssh(1) is au‐\nthenticating a server, this will be the host name given by the user, the value of the ssh(1)\nHostkeyAlias if it was specified, or the canonical server hostname if the ssh(1)\nCanonicalizeHostname option was used.\n\nA pattern may also be preceded by ‘!’ to indicate negation: if the host name matches a negated\npattern, it is not accepted (by that line) even if it matched another pattern on the line.  A\nhostname or address may optionally be enclosed within ‘[’ and ‘]’ brackets then followed by ‘:’\nand a non-standard port number.\n\nAlternately, hostnames may be stored in a hashed form which hides host names and addresses\nshould the file's contents be disclosed.  Hashed hostnames start with a ‘|’ character.  Only\none hashed hostname may appear on a single line and none of the above negation or wildcard op‐\nerators may be applied.\n\nThe keytype and base64-encoded key are taken directly from the host key; they can be obtained,\nfor example, from /etc/ssh/sshhostrsakey.pub.  The optional comment field continues to the\nend of the line, and is not used.\n\nLines starting with ‘#’ and empty lines are ignored as comments.\n\nWhen performing host authentication, authentication is accepted if any matching line has the\nproper key; either one that matches exactly or, if the server has presented a certificate for\nauthentication, the key of the certification authority that signed the certificate.  For a key\nto be trusted as a certification authority, it must use the “@cert-authority” marker described\nabove.\n\nThe known hosts file also provides a facility to mark keys as revoked, for example when it is\nknown that the associated private key has been stolen.  Revoked keys are specified by including\nthe “@revoked” marker at the beginning of the key line, and are never accepted for authentica‐\ntion or as certification authorities, but instead will produce a warning from ssh(1) when they\nare encountered.\n\nIt is permissible (but not recommended) to have several lines or different host keys for the\nsame names.  This will inevitably happen when short forms of host names from different domains\nare put in the file.  It is possible that the files contain conflicting information; authenti‐\ncation is accepted if valid information can be found from either file.\n\nNote that the lines in these files are typically hundreds of characters long, and you defi‐\nnitely don't want to type in the host keys by hand.  Rather, generate them by a script,\nssh-keyscan(1) or by taking, for example, /etc/ssh/sshhostrsakey.pub and adding the host\nnames at the front.  ssh-keygen(1) also offers some basic automated editing for\n~/.ssh/knownhosts including removing hosts matching a host name and converting all host names\nto their hashed representations.\n\nAn example sshknownhosts file:\n\n# Comments allowed at start of line\nclosenet,...,192.0.2.53 1024 37 159...93 closenet.example.net\ncvs.example.net,192.0.2.10 ssh-rsa AAAA1234.....=\n# A hashed hostname\n|1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa\nAAAA1234.....=\n# A revoked key\n@revoked * ssh-rsa AAAAB5W...\n# A CA key, accepted for any host in *.mydomain.com or *.mydomain.org\n@cert-authority *.mydomain.org,*.mydomain.com ssh-rsa AAAAB5W...\n",
            "subsections": []
        },
        "FILES": {
            "content": "~/.hushlogin\nThis file is used to suppress printing the last login time and /etc/motd, if\nPrintLastLog and PrintMotd, respectively, are enabled.  It does not suppress printing\nof the banner specified by Banner.\n\n~/.rhosts\nThis file is used for host-based authentication (see ssh(1) for more information).  On\nsome machines this file may need to be world-readable if the user's home directory is\non an NFS partition, because sshd reads it as root.  Additionally, this file must be\nowned by the user, and must not have write permissions for anyone else.  The recom‐\nmended permission for most machines is read/write for the user, and not accessible by\nothers.\n\n~/.shosts\nThis file is used in exactly the same way as .rhosts, but allows host-based authentica‐\ntion without permitting login with rlogin/rsh.\n\n~/.ssh/\nThis directory is the default location for all user-specific configuration and authen‐\ntication information.  There is no general requirement to keep the entire contents of\nthis directory secret, but the recommended permissions are read/write/execute for the\nuser, and not accessible by others.\n\n~/.ssh/authorizedkeys\nLists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used for logging in as\nthis user.  The format of this file is described above.  The content of the file is not\nhighly sensitive, but the recommended permissions are read/write for the user, and not\naccessible by others.\n\nIf this file, the ~/.ssh directory, or the user's home directory are writable by other\nusers, then the file could be modified or replaced by unauthorized users.  In this\ncase, sshd will not allow it to be used unless the StrictModes option has been set to\n“no”.\n\n~/.ssh/environment\nThis file is read into the environment at login (if it exists).  It can only contain\nempty lines, comment lines (that start with ‘#’), and assignment lines of the form\nname=value.  The file should be writable only by the user; it need not be readable by\nanyone else.  Environment processing is disabled by default and is controlled via the\nPermitUserEnvironment option.\n\n~/.ssh/knownhosts\nContains a list of host keys for all hosts the user has logged into that are not al‐\nready in the systemwide list of known host keys.  The format of this file is described\nabove.  This file should be writable only by root/the owner and can, but need not be,\nworld-readable.\n\n~/.ssh/rc\nContains initialization routines to be run before the user's home directory becomes ac‐\ncessible.  This file should be writable only by the user, and need not be readable by\nanyone else.\n\n/etc/hosts.allow\n/etc/hosts.deny\nAccess controls that should be enforced by tcp-wrappers are defined here.  Further de‐\ntails are described in hostsaccess(5).\n\n/etc/hosts.equiv\nThis file is for host-based authentication (see ssh(1)).  It should only be writable by\nroot.\n\n/etc/ssh/moduli\nContains Diffie-Hellman groups used for the \"Diffie-Hellman Group Exchange\" key ex‐\nchange method.  The file format is described in moduli(5).  If no usable groups are\nfound in this file then fixed internal groups will be used.\n\n/etc/motd\nSee motd(5).\n\n/etc/nologin\nIf this file exists, sshd refuses to let anyone except root log in.  The contents of\nthe file are displayed to anyone trying to log in, and non-root connections are re‐\nfused.  The file should be world-readable.\n\n/etc/ssh/shosts.equiv\nThis file is used in exactly the same way as hosts.equiv, but allows host-based authen‐\ntication without permitting login with rlogin/rsh.\n\n/etc/ssh/sshhostecdsakey\n/etc/ssh/sshhosted25519key\n/etc/ssh/sshhostrsakey\nThese files contain the private parts of the host keys.  These files should only be\nowned by root, readable only by root, and not accessible to others.  Note that sshd\ndoes not start if these files are group/world-accessible.\n\n/etc/ssh/sshhostecdsakey.pub\n/etc/ssh/sshhosted25519key.pub\n/etc/ssh/sshhostrsakey.pub\nThese files contain the public parts of the host keys.  These files should be world-\nreadable but writable only by root.  Their contents should match the respective private\nparts.  These files are not really used for anything; they are provided for the conve‐\nnience of the user so their contents can be copied to known hosts files.  These files\nare created using ssh-keygen(1).\n\n/etc/ssh/sshknownhosts\nSystemwide list of known host keys.  This file should be prepared by the system admin‐\nistrator to contain the public host keys of all machines in the organization.  The for‐\nmat of this file is described above.  This file should be writable only by root/the\nowner and should be world-readable.\n\n/etc/ssh/sshdconfig\nContains configuration data for sshd.  The file format and configuration options are\ndescribed in sshdconfig(5).\n\n/etc/ssh/sshrc\nSimilar to ~/.ssh/rc, it can be used to specify machine-specific login-time initializa‐\ntions globally.  This file should be writable only by root, and should be world-read‐\nable.\n\n/run/sshd\nchroot(2) directory used by sshd during privilege separation in the pre-authentication\nphase.  The directory should not contain any files and must be owned by root and not\ngroup or world-writable.\n\n/run/sshd.pid\nContains the process ID of the sshd listening for connections (if there are several\ndaemons running concurrently for different ports, this contains the process ID of the\none started last).  The content of this file is not sensitive; it can be world-read‐\nable.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh-keyscan(1), chroot(2),\nhostsaccess(5), moduli(5), sshdconfig(5), inetd(8), sftp-server(8)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen.  Aaron\nCampbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs,\nre-added newer features and created OpenSSH.  Markus Friedl contributed the support for SSH\nprotocol versions 1.5 and 2.0.  Niels Provos and Markus Friedl contributed support for privi‐\nlege separation.\n\nBSD                           September 10, 2021                           BSD",
            "subsections": []
        }
    },
    "summary": "sshd — OpenSSH daemon",
    "flags": [
        {
            "flag": "-4",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "Specify the connection parameters to use for the -T extended test mode. If provided, any Match directives in the configuration file that would apply are applied before the configuration is written to standard output. The connection parameters are supplied as keyword=value pairs and may be supplied in any order, either with multiple -C options or as a comma-separated list. The keywords are “addr”, “user”, “host”, “laddr”, “lport”, and “rdomain” and correspond to source address, user, resolved source host name, local address, local port number and routing domain respectively."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Specifies a path to a certificate file to identify sshd during key exchange. The cer‐ tificate file must match a host key file specified using the -h option or the HostKey configuration directive."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "allows easy monitoring of sshd."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "itself in the background. The server also will not fork(2) and will only process one connection. This option is only intended for debugging for the server. Multiple -d options increase the debugging level. Maximum is 3."
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "Append debug logs to logfile instead of the system log."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Specifies the name of the configuration file. The default is /etc/ssh/sshdconfig. sshd refuses to start if there is no configuration file."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "Gives the grace time for clients to authenticate themselves (default 120 seconds). If the client fails to authenticate the user within this many seconds, the server discon‐ nects and exits. A value of zero indicates no limit."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Specifies a file from which a host key is read. This option must be given if sshd is not run as root (as the normal host key files are normally not readable by anyone but root). The default is /etc/ssh/sshhostecdsakey, /etc/ssh/sshhosted25519key and /etc/ssh/sshhostrsakey. It is possible to have multiple host key files for the dif‐ ferent host key algorithms."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Can be used to give options in the format used in the configuration file. This is use‐ ful for specifying options for which there is no separate command-line flag. For full details of the options, and their values, see sshdconfig(5)."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Specifies the port on which the server listens for connections (default 22). Multiple port options are permitted. Ports specified in the configuration file with the Port option are ignored when a command-line port is specified. Ports specified using the ListenAddress option override command-line ports."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "tion, and termination of each connection is logged."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "configuration to stdout and then exit. Optionally, Match rules may be applied by spec‐ ifying the connection parameters using one or more -C options."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "This is useful for updating sshd reliably as configuration options may change."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "the remote host name. If the resolved host name is longer than len, the dotted decimal value will be used instead. This allows hosts with very long host names that overflow this field to still be uniquely identified. Specifying -u0 indicates that only dotted decimal addresses should be put into the utmp file. -u0 may also be used to prevent sshd from making DNS requests unless the authentication mechanism or configuration re‐ quires it. Authentication mechanisms that may require DNS include HostbasedAuthentication and using a from=\"pattern-list\" option in a key file. Configu‐ ration options that require DNS include using a USER@HOST pattern in AllowUsers or DenyUsers."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "scp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/scp/1/json"
        },
        {
            "name": "sftp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sftp/1/json"
        },
        {
            "name": "ssh",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh/1/json"
        },
        {
            "name": "ssh-add",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh-add/1/json"
        },
        {
            "name": "ssh-agent",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh-agent/1/json"
        },
        {
            "name": "ssh-keygen",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh-keygen/1/json"
        },
        {
            "name": "ssh-keyscan",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh-keyscan/1/json"
        },
        {
            "name": "chroot",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/chroot/2/json"
        },
        {
            "name": "hostsaccess",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/hostsaccess/5/json"
        },
        {
            "name": "moduli",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/moduli/5/json"
        },
        {
            "name": "sshdconfig",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sshdconfig/5/json"
        },
        {
            "name": "inetd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/inetd/8/json"
        },
        {
            "name": "sftp-server",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sftp-server/8/json"
        }
    ]
}