{
    "content": [
        {
            "type": "text",
            "text": "# sshd (man)\n\n## NAME\n\nsshd — OpenSSH daemon\n\n## SYNOPSIS\n\nsshd   [-46DdeGiqTtV]   [-C   connectionspec]   [-c   hostcertificatefile]  [-E  logfile]\n[-f configfile] [-g logingracetime] [-h hostkeyfile] [-o option] [-p port] [-u len]\n\n## DESCRIPTION\n\nsshd (OpenSSH Daemon) is the daemon program for ssh(1).  It provides secure encrypted  commu‐\nnications between two untrusted hosts over an insecure network.\n\n## TLDR\n\n> Secure Shell Daemon - allows remote machines to securely log in to the current machine.\n\n- Start daemon in the background:\n  `sshd`\n- Run sshd in the foreground:\n  `sshd -D`\n- Run with verbose output (for debugging):\n  `sshd -D -d`\n- Run on a specific port:\n  `sshd -p {{port}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (20 subsections)\n- **AUTHENTICATION**\n- **LOGIN PROCESS**\n- **SSHRC**\n- **AUTHORIZEDKEYS FILE FORMAT** (20 subsections)\n- **SSHKNOWNHOSTS FILE FORMAT**\n- **FILES**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "sshd",
        "section": "",
        "mode": "man",
        "summary": "sshd — OpenSSH daemon",
        "synopsis": "sshd   [-46DdeGiqTtV]   [-C   connectionspec]   [-c   hostcertificatefile]  [-E  logfile]\n[-f configfile] [-g logingracetime] [-h hostkeyfile] [-o option] [-p port] [-u len]",
        "tldr_summary": "Secure Shell Daemon - allows remote machines to securely log in to the current machine.",
        "tldr_examples": [
            {
                "description": "Start daemon in the background",
                "command": "sshd"
            },
            {
                "description": "Run sshd in the foreground",
                "command": "sshd -D"
            },
            {
                "description": "Run with verbose output (for debugging)",
                "command": "sshd -D -d"
            },
            {
                "description": "Run on a specific port",
                "command": "sshd -p {{port}}"
            }
        ],
        "tldr_source": "official",
        "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 sup‐ plied 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 certificate file must match a host key file specified using the -h option or the HostKey configuration directive."
            },
            {
                "flag": "-D",
                "long": null,
                "arg": null,
                "description": "This allows easy monitoring of sshd."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "put 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": "output the effective configuration to stdout and then exit. Optionally, Match rules may be applied by specifying the connection parameters using one or more -C options."
            },
            {
                "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 disconnects 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 different 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 useful 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). Multi‐ ple 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": "tive configuration to stdout and then exit. Optionally, Match rules may be applied by specifying the connection parameters using one or more -C options. This is simi‐ lar to the -G flag, but it includes the additional testing performed by the -t flag."
            },
            {
                "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 deci‐ mal 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 con‐ figuration requires it. Authentication mechanisms that may require DNS include HostbasedAuthentication and using a from=\"pattern-list\" option in a key file. Con‐ figuration options that require DNS include using a USER@HOST pattern in AllowUsers or DenyUsers."
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": [
                    {
                        "name": "-4",
                        "lines": 1,
                        "flag": "-4"
                    },
                    {
                        "name": "-6",
                        "lines": 1,
                        "flag": "-6"
                    },
                    {
                        "name": "-C _",
                        "lines": 8,
                        "flag": "-C"
                    },
                    {
                        "name": "-c _",
                        "lines": 4,
                        "flag": "-c"
                    },
                    {
                        "name": "-D",
                        "lines": 2,
                        "flag": "-D"
                    },
                    {
                        "name": "-d",
                        "lines": 4,
                        "flag": "-d"
                    },
                    {
                        "name": "-E _",
                        "lines": 2,
                        "flag": "-E"
                    },
                    {
                        "name": "-e",
                        "lines": 1,
                        "flag": "-e"
                    },
                    {
                        "name": "-f _",
                        "lines": 3,
                        "flag": "-f"
                    },
                    {
                        "name": "-G",
                        "lines": 3,
                        "flag": "-G"
                    },
                    {
                        "name": "-g _",
                        "lines": 4,
                        "flag": "-g"
                    },
                    {
                        "name": "-h _",
                        "lines": 6,
                        "flag": "-h"
                    },
                    {
                        "name": "-i",
                        "lines": 1,
                        "flag": "-i"
                    },
                    {
                        "name": "-o _",
                        "lines": 4,
                        "flag": "-o"
                    },
                    {
                        "name": "-p _",
                        "lines": 5,
                        "flag": "-p"
                    },
                    {
                        "name": "-q",
                        "lines": 2,
                        "flag": "-q"
                    },
                    {
                        "name": "-T",
                        "lines": 4,
                        "flag": "-T"
                    },
                    {
                        "name": "-t",
                        "lines": 2,
                        "flag": "-t"
                    },
                    {
                        "name": "-u _",
                        "lines": 10,
                        "flag": "-u"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    }
                ]
            },
            {
                "name": "AUTHENTICATION",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "LOGIN PROCESS",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "SSHRC",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "AUTHORIZEDKEYS FILE FORMAT",
                "lines": 30,
                "subsections": [
                    {
                        "name": "agent-forwarding",
                        "lines": 2
                    },
                    {
                        "name": "cert-authority",
                        "lines": 7
                    },
                    {
                        "name": "command=\"command\"",
                        "lines": 20
                    },
                    {
                        "name": "environment=\"NAME=value\"",
                        "lines": 5
                    },
                    {
                        "name": "expiry-time=\"timespec\"",
                        "lines": 5
                    },
                    {
                        "name": "from=\"pattern-list\"",
                        "lines": 14
                    },
                    {
                        "name": "no-agent-forwarding",
                        "lines": 2
                    },
                    {
                        "name": "no-port-forwarding",
                        "lines": 6
                    },
                    {
                        "name": "no-user-rc",
                        "lines": 2
                    },
                    {
                        "name": "no-X11-forwarding",
                        "lines": 3
                    },
                    {
                        "name": "permitlisten=\"[host:]port\"",
                        "lines": 10
                    },
                    {
                        "name": "permitopen=\"host:port\"",
                        "lines": 7
                    },
                    {
                        "name": "port-forwarding",
                        "lines": 2
                    },
                    {
                        "name": "principals=\"principals\"",
                        "lines": 8
                    },
                    {
                        "name": "no-touch-required",
                        "lines": 4
                    },
                    {
                        "name": "verify-required",
                        "lines": 4
                    },
                    {
                        "name": "restrict",
                        "lines": 4
                    },
                    {
                        "name": "tunnel=\"n\"",
                        "lines": 3
                    },
                    {
                        "name": "user-rc",
                        "lines": 2
                    },
                    {
                        "name": "X11-forwarding",
                        "lines": 24
                    }
                ]
            },
            {
                "name": "SSHKNOWNHOSTS FILE FORMAT",
                "lines": 72,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 120,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "sshd — OpenSSH daemon\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "sshd   [-46DdeGiqTtV]   [-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  commu‐\nnications 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\nhandle 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\nitself 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\nthe  configuration is written to standard output.  The connection parameters are sup‐\nplied as keyword=value pairs and may be supplied in any order, either  with  multiple\n-C  options  or  as a comma-separated list.  The keywords are “addr”, “user”, “host”,\n“laddr”, “lport”, and “rdomain” and correspond  to  source  address,  user,  resolved\nsource host name, 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\ncertificate file must match a host key file specified using  the  -h  option  or  the\nHostKey configuration directive.\n",
                        "flag": "-c"
                    },
                    {
                        "name": "-D",
                        "content": "This allows easy monitoring of sshd.\n",
                        "flag": "-D"
                    },
                    {
                        "name": "-d",
                        "content": "put itself in the background.  The server also will not fork(2) and will only process\none connection.  This option is only intended for debugging for the server.  Multiple\n-d options 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": "output  the effective configuration to stdout and then exit.  Optionally, Match rules\nmay be applied by specifying the connection parameters using one or more -C options.\n",
                        "flag": "-G"
                    },
                    {
                        "name": "-g _",
                        "content": "Gives the grace time for clients to authenticate themselves  (default  120  seconds).\nIf  the  client  fails  to authenticate the user within this many seconds, the server\ndisconnects 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\ndifferent 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\nuseful for specifying options for which there is no separate command-line flag.   For\nfull details 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).  Multi‐\nple port options are permitted.  Ports specified in the configuration file  with  the\nPort option are ignored when a command-line port is specified.  Ports specified using\nthe ListenAddress 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": "tive  configuration  to stdout and then exit.  Optionally, Match rules may be applied\nby specifying the connection parameters using one or more -C options.  This is  simi‐\nlar to the -G flag, but it includes the additional testing performed by the -t flag.\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 deci‐\nmal  value  will  be  used instead.  This allows hosts with very long host names that\noverflow this field to still be uniquely identified.  Specifying -u0  indicates  that\nonly dotted decimal addresses should be put into the utmp file.  -u0 may also be used\nto  prevent sshd from making DNS requests unless the authentication mechanism or con‐\nfiguration requires it.  Authentication  mechanisms  that  may  require  DNS  include\nHostbasedAuthentication  and  using a from=\"pattern-list\" option in a key file.  Con‐\nfiguration options that require DNS include using a USER@HOST pattern  in  AllowUsers\nor DenyUsers.\n",
                        "flag": "-u"
                    },
                    {
                        "name": "-V",
                        "content": "",
                        "flag": "-V"
                    }
                ]
            },
            "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\nagreement results in a shared session key.  The rest of the session is encrypted using a sym‐\nmetric cipher.  The client selects the encryption algorithm to use from those offered by  the\nserver.   Additionally, session integrity is provided through a cryptographic message authen‐\ntication code (MAC).\n\nFinally, the server and the client enter an authentication dialog.  The client tries  to  au‐\nthenticate  itself  using host-based authentication, public key authentication, challenge-re‐\nsponse authentication, or password authentication.\n\nRegardless of the authentication type, the account is checked to ensure that it  is  accessi‐\nble.   An  account  is  not  accessible  if it is locked, listed in DenyUsers or its group is\nlisted in DenyGroups .  The definition of a locked account is system  dependent.  Some  plat‐\nforms  have  their own account database (eg AIX) and some modify the passwd field ( ‘*LK*’ on\nSolaris and UnixWare, ‘*’ on HP-UX, containing ‘Nologin’ on Tru64, a  leading  ‘*LOCKED*’  on\nFreeBSD  and  a  leading ‘!’ on most Linuxes).  If there is a requirement to disable password\nauthentication for the account while allowing still public-key, then the passwd field  should\nbe set to something other than these values (eg ‘NP’ or ‘*NP*’ ).\n\nIf  the  client  successfully authenticates itself, a dialog for preparing the session is en‐\ntered.  At this time the client may request things like allocating a  pseudo-tty,  forwarding\nX11  connections,  forwarding TCP connections, or forwarding the authentication agent connec‐\ntion over the secure channel.\n\nAfter this, the client either requests an interactive shell or execution of a non-interactive\ncommand, which sshd will execute via the user's shell using its -c option.   The  sides  then\nenter  session  mode.   In this mode, either side may send data at any time, and such data is\nforwarded to/from the shell or command on the server side,  and  the  user  terminal  in  the\nclient side.\n\nWhen  the  user  program  terminates  and  all  forwarded X11 and other connections have been\nclosed, the 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\ntime and /etc/motd (unless prevented in the configuration file or by ~/.hushlogin;\nsee the “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;\nelse  if  /etc/ssh/sshrc exists, runs it; otherwise runs xauth(1).  The “rc” files\nare given the X11 authentication protocol  and  cookie  in  standard  input.   See\n“SSHRC”, below.\n\n9.   Runs  user's  shell or command.  All commands are run under the user's login shell\nas specified 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\nbe used 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\nbefore the user's home directory becomes accessible; AFS is a particular example of  such  an\nenvironment.\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\nis used to add the cookie.\n",
                "subsections": []
            },
            "AUTHORIZEDKEYS FILE FORMAT": {
                "content": "AuthorizedKeysFile specifies the files containing public keys for public key  authentication;\nif   this   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\nstarting  with  a  ‘#’ are ignored as comments).  Public keys consist of the following space-\nseparated fields: options, keytype, base64-encoded key, comment.  The options  field  is  op‐\ntional.  The supported 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\nthe key).\n\nNote that lines in this file can be several hundred bytes long (because of the  size  of  the\npublic  key encoding) up to a limit of 8 kilobytes, which permits RSA keys up to 16 kilobits.\nYou don'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\npermitted, except within double quotes.  The following option  specifications  are  supported\n(note that 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\nvalidate signed certificates for user authentication.\n\nCertificates may encode access restrictions similar to these key  options.   If  both\ncertificate  restrictions  and key options are present, the most restrictive union of\nthe two 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\nchannel is required, one must not request a pty or should specify  no-pty.   A  quote\nmay be included in the command by quoting it with a backslash.\n\nThis  option  might  be useful to restrict certain public keys to perform just a spe‐\ncific operation.  An example might be a key that permits remote backups  but  nothing\nelse.  Note that the client may specify TCP and/or X11 forwarding unless they are ex‐\nplicitly prohibited, e.g. using the restrict key option.\n\nThe   command   originally   supplied   by   the   client   is   available   in   the\nSSHORIGINALCOMMAND environment variable.  Note that this option applies  to  shell,\ncommand  or  subsystem execution.  Also note that this command may be superseded by a\nsshdconfig(5) ForceCommand 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\nthis key.  Environment variables set this way override other default environment val‐\nues.   Multiple  options  of this type are permitted.  Environment processing is dis‐\nabled by default 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[Z] date or a YYYYMMDDHHMM[SS][Z] time.  Dates and times will be  inter‐\npreted  in  the system time zone unless suffixed by a Z character, in which case they\nwill be interpreted in the UTC 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\nfrom anywhere in the world.  This additional option makes using  a  stolen  key  more\ndifficult  (name  servers  and/or routers would have to be compromised in addition to\njust 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\nrequests  by the client will return an error.  This might be used, e.g. in connection\nwith the 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\non  the  specified  host (optional) and port.  IPv6 addresses can be specified by en‐\nclosing the address in square brackets.  Multiple permitlisten options may be applied\nseparated by commas.  Hostnames may include wildcards as described  in  the  PATTERNS\nsection in sshconfig(5).  A port specification of * matches any port.  Note that the\nsetting of GatewayPorts may further restrict listen addresses.  Note that ssh(1) will\nsend a hostname of “localhost” if a listen host was not specified when the forwarding\nwas  requested,  and  that this name is treated differently to the explicit localhost\naddresses “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\nto the specified host and port.  IPv6 addresses can be specified by enclosing the ad‐\ndress  in  square  brackets.  Multiple permitopen options may be applied separated by\ncommas.  No pattern matching or name lookup is performed on the specified  hostnames,\nthey  must be literal host names and/or addresses.  A port specification of * matches\nany 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  cer‐\ntificate's list of principals for the certificate to be accepted.  This option is ig‐\nnored  for  keys  that  are  not  marked  as  trusted  certificate  signers using the\ncert-authority option.\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.\nThis  option  only  makes  sense  for  the FIDO authenticator algorithms ecdsa-sk and\ned25519-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\necdsa-sk and 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 capabil‐\nities 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\nper-user file is maintained automatically: whenever the user connects to an unknown host, its\nkey is added to the per-user file.\n\nEach  line  in  these files contains the following fields: marker (optional), hostnames, key‐\ntype, base64-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 in‐\ndicate that the line contains a certification authority (CA) key, or “@revoked”, to  indicate\nthat the key contained on the line is revoked and must not ever be accepted.  Only one marker\nshould be used on a key line.\n\nHostnames  is a comma-separated list of patterns (‘*’ and ‘?’ act as wildcards); each pattern\nin turn is matched against the host name.  When sshd is authenticating a client, such as when\nusing HostbasedAuthentication, this will be the canonical client host name.  When  ssh(1)  is\nauthenticating  a  server,  this  will  be  the host name given by the user, the value of the\nssh(1) HostkeyAlias 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\nnegated pattern, it is not accepted (by that line) even if it matched another pattern on  the\nline.  A hostname or address may optionally be enclosed within ‘[’ and ‘]’ brackets then fol‐\nlowed by ‘:’ and 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\noperators may be applied.\n\nThe keytype and base64-encoded key are taken directly from the host  key;  they  can  be  ob‐\ntained,  for example, from /etc/ssh/sshhostrsakey.pub.  The optional comment field contin‐\nues to the end 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\nkey to be trusted as a certification authority, it must use the “@cert-authority” marker  de‐\nscribed above.\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 includ‐\ning  the  “@revoked”  marker at the beginning of the key line, and are never accepted for au‐\nthentication or as certification authorities, but instead will produce a warning from  ssh(1)\nwhen they are 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  do‐\nmains  are  put  in the file.  It is possible that the files contain conflicting information;\nauthentication 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\nnames to their hashed representations.\n\nAn example sshknownhosts file:\n\n# Comments allowed at start of line\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).\nOn some machines this file may need to be world-readable if the user's home directory\nis  on an NFS partition, because sshd reads it as root.  Additionally, this file must\nbe owned by the user, and must not have write permissions for anyone else.  The  rec‐\nommended  permission for most machines is read/write for the user, and not accessible\nby others.\n\n~/.shosts\nThis file is used in exactly the same way as .rhosts, but allows host-based authenti‐\ncation without permitting login with rlogin/rsh.\n\n~/.ssh/\nThis directory is the default location for all user-specific  configuration  and  au‐\nthentication  information.   There  is no general requirement to keep the entire con‐\ntents of this directory secret, but the recommended permissions  are  read/write/exe‐\ncute for the user, 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\nnot  highly  sensitive,  but the recommended permissions are read/write for the user,\nand not accessible by others.\n\nIf this file, the ~/.ssh directory, or the user's  home  directory  are  writable  by\nother  users,  then the file could be modified or replaced by unauthorized users.  In\nthis case, sshd will not allow it to be used unless the StrictModes option  has  been\nset to “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  de‐\nscribed above.  This file should be writable only by root/the owner and can, but need\nnot be, world-readable.\n\n~/.ssh/rc\nContains  initialization  routines to be run before the user's home directory becomes\naccessible.  This file should be writable only by the user, and need not be  readable\nby anyone else.\n\n/etc/hosts.allow\n/etc/hosts.deny\nAccess  controls  that  should be enforced by tcp-wrappers are defined here.  Further\ndetails 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\nby root.\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 au‐\nthentication 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 pri‐\nvate parts.  These files are not really used for anything; they are provided for  the\nconvenience  of the user so their contents can be copied to known hosts files.  These\nfiles are created using ssh-keygen(1).\n\n/etc/ssh/sshknownhosts\nSystemwide list of known host keys.  This file should be prepared by the  system  ad‐\nministrator to contain the public host keys of all machines in the organization.  The\nformat  of  this  file  is  described  above.   This  file should be writable only by\nroot/the owner 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 initial‐\nizations globally.  This file should be writable only by root, and should  be  world-\nreadable.\n\n/run/sshd\nchroot(2)  directory  used by sshd during privilege separation in the pre-authentica‐\ntion phase.  The directory should not contain any files and must be owned by root and\nnot group 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\nbugs, re-added newer features and created OpenSSH.  Markus Friedl contributed the support for\nSSH  protocol  versions  1.5 and 2.0.  Niels Provos and Markus Friedl contributed support for\nprivilege separation.\n\nDebian                                   September 19, 2023                                  SSHD(8)",
                "subsections": []
            }
        }
    }
}