ssh_config.5 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124
  1. .\"
  2. .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
  3. .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  4. .\" All rights reserved
  5. .\"
  6. .\" As far as I am concerned, the code I have written for this software
  7. .\" can be used freely for any purpose. Any derived versions of this
  8. .\" software must be clearly marked as such, and if the derived work is
  9. .\" incompatible with the protocol description in the RFC file, it must be
  10. .\" called by a name other than "ssh" or "Secure Shell".
  11. .\"
  12. .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
  13. .\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
  14. .\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
  15. .\"
  16. .\" Redistribution and use in source and binary forms, with or without
  17. .\" modification, are permitted provided that the following conditions
  18. .\" are met:
  19. .\" 1. Redistributions of source code must retain the above copyright
  20. .\" notice, this list of conditions and the following disclaimer.
  21. .\" 2. Redistributions in binary form must reproduce the above copyright
  22. .\" notice, this list of conditions and the following disclaimer in the
  23. .\" documentation and/or other materials provided with the distribution.
  24. .\"
  25. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  26. .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  27. .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  28. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  29. .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  30. .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  34. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. .\"
  36. .\" $OpenBSD: ssh_config.5,v 1.333 2020/10/03 04:15:06 djm Exp $
  37. .Dd $Mdocdate: October 3 2020 $
  38. .Dt SSH_CONFIG 5
  39. .Os
  40. .Sh NAME
  41. .Nm ssh_config
  42. .Nd OpenSSH client configuration file
  43. .Sh DESCRIPTION
  44. .Xr ssh 1
  45. obtains configuration data from the following sources in
  46. the following order:
  47. .Pp
  48. .Bl -enum -offset indent -compact
  49. .It
  50. command-line options
  51. .It
  52. user's configuration file
  53. .Pq Pa ~/.ssh/config
  54. .It
  55. system-wide configuration file
  56. .Pq Pa /etc/ssh/ssh_config
  57. .El
  58. .Pp
  59. For each parameter, the first obtained value
  60. will be used.
  61. The configuration files contain sections separated by
  62. .Cm Host
  63. specifications, and that section is only applied for hosts that
  64. match one of the patterns given in the specification.
  65. The matched host name is usually the one given on the command line
  66. (see the
  67. .Cm CanonicalizeHostname
  68. option for exceptions).
  69. .Pp
  70. Since the first obtained value for each parameter is used, more
  71. host-specific declarations should be given near the beginning of the
  72. file, and general defaults at the end.
  73. .Pp
  74. The file contains keyword-argument pairs, one per line.
  75. Lines starting with
  76. .Ql #
  77. and empty lines are interpreted as comments.
  78. Arguments may optionally be enclosed in double quotes
  79. .Pq \&"
  80. in order to represent arguments containing spaces.
  81. Configuration options may be separated by whitespace or
  82. optional whitespace and exactly one
  83. .Ql = ;
  84. the latter format is useful to avoid the need to quote whitespace
  85. when specifying configuration options using the
  86. .Nm ssh ,
  87. .Nm scp ,
  88. and
  89. .Nm sftp
  90. .Fl o
  91. option.
  92. .Pp
  93. The possible
  94. keywords and their meanings are as follows (note that
  95. keywords are case-insensitive and arguments are case-sensitive):
  96. .Bl -tag -width Ds
  97. .It Cm Host
  98. Restricts the following declarations (up to the next
  99. .Cm Host
  100. or
  101. .Cm Match
  102. keyword) to be only for those hosts that match one of the patterns
  103. given after the keyword.
  104. If more than one pattern is provided, they should be separated by whitespace.
  105. A single
  106. .Ql *
  107. as a pattern can be used to provide global
  108. defaults for all hosts.
  109. The host is usually the
  110. .Ar hostname
  111. argument given on the command line
  112. (see the
  113. .Cm CanonicalizeHostname
  114. keyword for exceptions).
  115. .Pp
  116. A pattern entry may be negated by prefixing it with an exclamation mark
  117. .Pq Sq !\& .
  118. If a negated entry is matched, then the
  119. .Cm Host
  120. entry is ignored, regardless of whether any other patterns on the line
  121. match.
  122. Negated matches are therefore useful to provide exceptions for wildcard
  123. matches.
  124. .Pp
  125. See
  126. .Sx PATTERNS
  127. for more information on patterns.
  128. .It Cm Match
  129. Restricts the following declarations (up to the next
  130. .Cm Host
  131. or
  132. .Cm Match
  133. keyword) to be used only when the conditions following the
  134. .Cm Match
  135. keyword are satisfied.
  136. Match conditions are specified using one or more criteria
  137. or the single token
  138. .Cm all
  139. which always matches.
  140. The available criteria keywords are:
  141. .Cm canonical ,
  142. .Cm final ,
  143. .Cm exec ,
  144. .Cm host ,
  145. .Cm originalhost ,
  146. .Cm user ,
  147. and
  148. .Cm localuser .
  149. The
  150. .Cm all
  151. criteria must appear alone or immediately after
  152. .Cm canonical
  153. or
  154. .Cm final .
  155. Other criteria may be combined arbitrarily.
  156. All criteria but
  157. .Cm all ,
  158. .Cm canonical ,
  159. and
  160. .Cm final
  161. require an argument.
  162. Criteria may be negated by prepending an exclamation mark
  163. .Pq Sq !\& .
  164. .Pp
  165. The
  166. .Cm canonical
  167. keyword matches only when the configuration file is being re-parsed
  168. after hostname canonicalization (see the
  169. .Cm CanonicalizeHostname
  170. option).
  171. This may be useful to specify conditions that work with canonical host
  172. names only.
  173. .Pp
  174. The
  175. .Cm final
  176. keyword requests that the configuration be re-parsed (regardless of whether
  177. .Cm CanonicalizeHostname
  178. is enabled), and matches only during this final pass.
  179. If
  180. .Cm CanonicalizeHostname
  181. is enabled, then
  182. .Cm canonical
  183. and
  184. .Cm final
  185. match during the same pass.
  186. .Pp
  187. The
  188. .Cm exec
  189. keyword executes the specified command under the user's shell.
  190. If the command returns a zero exit status then the condition is considered true.
  191. Commands containing whitespace characters must be quoted.
  192. Arguments to
  193. .Cm exec
  194. accept the tokens described in the
  195. .Sx TOKENS
  196. section.
  197. .Pp
  198. The other keywords' criteria must be single entries or comma-separated
  199. lists and may use the wildcard and negation operators described in the
  200. .Sx PATTERNS
  201. section.
  202. The criteria for the
  203. .Cm host
  204. keyword are matched against the target hostname, after any substitution
  205. by the
  206. .Cm Hostname
  207. or
  208. .Cm CanonicalizeHostname
  209. options.
  210. The
  211. .Cm originalhost
  212. keyword matches against the hostname as it was specified on the command-line.
  213. The
  214. .Cm user
  215. keyword matches against the target username on the remote host.
  216. The
  217. .Cm localuser
  218. keyword matches against the name of the local user running
  219. .Xr ssh 1
  220. (this keyword may be useful in system-wide
  221. .Nm
  222. files).
  223. .It Cm AddKeysToAgent
  224. Specifies whether keys should be automatically added to a running
  225. .Xr ssh-agent 1 .
  226. If this option is set to
  227. .Cm yes
  228. and a key is loaded from a file, the key and its passphrase are added to
  229. the agent with the default lifetime, as if by
  230. .Xr ssh-add 1 .
  231. If this option is set to
  232. .Cm ask ,
  233. .Xr ssh 1
  234. will require confirmation using the
  235. .Ev SSH_ASKPASS
  236. program before adding a key (see
  237. .Xr ssh-add 1
  238. for details).
  239. If this option is set to
  240. .Cm confirm ,
  241. each use of the key must be confirmed, as if the
  242. .Fl c
  243. option was specified to
  244. .Xr ssh-add 1 .
  245. If this option is set to
  246. .Cm no ,
  247. no keys are added to the agent.
  248. Alternately, this option may be specified as a time interval
  249. using the format described in the
  250. .Sx TIME FORMATS
  251. section of
  252. .Xr sshd_config 5
  253. to specify the key's lifetime in
  254. .Xr ssh-agent 1 ,
  255. after which it will automatically be removed.
  256. The argument must be
  257. .Cm no
  258. (the default),
  259. .Cm yes ,
  260. .Cm confirm
  261. (optionally followed by a time interval),
  262. .Cm ask
  263. or a time interval.
  264. .It Cm AddressFamily
  265. Specifies which address family to use when connecting.
  266. Valid arguments are
  267. .Cm any
  268. (the default),
  269. .Cm inet
  270. (use IPv4 only), or
  271. .Cm inet6
  272. (use IPv6 only).
  273. .It Cm BatchMode
  274. If set to
  275. .Cm yes ,
  276. user interaction such as password prompts and host key confirmation requests
  277. will be disabled.
  278. In addition, the
  279. .Cm ServerAliveInterval
  280. option will be set to 300 seconds by default (Debian-specific).
  281. This option is useful in scripts and other batch jobs where no user
  282. is present to interact with
  283. .Xr ssh 1 ,
  284. and where it is desirable to detect a broken network swiftly.
  285. The argument must be
  286. .Cm yes
  287. or
  288. .Cm no
  289. (the default).
  290. .It Cm BindAddress
  291. Use the specified address on the local machine as the source address of
  292. the connection.
  293. Only useful on systems with more than one address.
  294. .It Cm BindInterface
  295. Use the address of the specified interface on the local machine as the
  296. source address of the connection.
  297. .It Cm CanonicalDomains
  298. When
  299. .Cm CanonicalizeHostname
  300. is enabled, this option specifies the list of domain suffixes in which to
  301. search for the specified destination host.
  302. .It Cm CanonicalizeFallbackLocal
  303. Specifies whether to fail with an error when hostname canonicalization fails.
  304. The default,
  305. .Cm yes ,
  306. will attempt to look up the unqualified hostname using the system resolver's
  307. search rules.
  308. A value of
  309. .Cm no
  310. will cause
  311. .Xr ssh 1
  312. to fail instantly if
  313. .Cm CanonicalizeHostname
  314. is enabled and the target hostname cannot be found in any of the domains
  315. specified by
  316. .Cm CanonicalDomains .
  317. .It Cm CanonicalizeHostname
  318. Controls whether explicit hostname canonicalization is performed.
  319. The default,
  320. .Cm no ,
  321. is not to perform any name rewriting and let the system resolver handle all
  322. hostname lookups.
  323. If set to
  324. .Cm yes
  325. then, for connections that do not use a
  326. .Cm ProxyCommand
  327. or
  328. .Cm ProxyJump ,
  329. .Xr ssh 1
  330. will attempt to canonicalize the hostname specified on the command line
  331. using the
  332. .Cm CanonicalDomains
  333. suffixes and
  334. .Cm CanonicalizePermittedCNAMEs
  335. rules.
  336. If
  337. .Cm CanonicalizeHostname
  338. is set to
  339. .Cm always ,
  340. then canonicalization is applied to proxied connections too.
  341. .Pp
  342. If this option is enabled, then the configuration files are processed
  343. again using the new target name to pick up any new configuration in matching
  344. .Cm Host
  345. and
  346. .Cm Match
  347. stanzas.
  348. .It Cm CanonicalizeMaxDots
  349. Specifies the maximum number of dot characters in a hostname before
  350. canonicalization is disabled.
  351. The default, 1,
  352. allows a single dot (i.e. hostname.subdomain).
  353. .It Cm CanonicalizePermittedCNAMEs
  354. Specifies rules to determine whether CNAMEs should be followed when
  355. canonicalizing hostnames.
  356. The rules consist of one or more arguments of
  357. .Ar source_domain_list : Ns Ar target_domain_list ,
  358. where
  359. .Ar source_domain_list
  360. is a pattern-list of domains that may follow CNAMEs in canonicalization,
  361. and
  362. .Ar target_domain_list
  363. is a pattern-list of domains that they may resolve to.
  364. .Pp
  365. For example,
  366. .Qq *.a.example.com:*.b.example.com,*.c.example.com
  367. will allow hostnames matching
  368. .Qq *.a.example.com
  369. to be canonicalized to names in the
  370. .Qq *.b.example.com
  371. or
  372. .Qq *.c.example.com
  373. domains.
  374. .It Cm CASignatureAlgorithms
  375. Specifies which algorithms are allowed for signing of certificates
  376. by certificate authorities (CAs).
  377. The default is:
  378. .Bd -literal -offset indent
  379. ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
  380. ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  381. .Ed
  382. .Pp
  383. .Xr ssh 1
  384. will not accept host certificates signed using algorithms other than those
  385. specified.
  386. .It Cm CertificateFile
  387. Specifies a file from which the user's certificate is read.
  388. A corresponding private key must be provided separately in order
  389. to use this certificate either
  390. from an
  391. .Cm IdentityFile
  392. directive or
  393. .Fl i
  394. flag to
  395. .Xr ssh 1 ,
  396. via
  397. .Xr ssh-agent 1 ,
  398. or via a
  399. .Cm PKCS11Provider
  400. or
  401. .Cm SecurityKeyProvider .
  402. .Pp
  403. Arguments to
  404. .Cm CertificateFile
  405. may use the tilde syntax to refer to a user's home directory,
  406. the tokens described in the
  407. .Sx TOKENS
  408. section and environment variables as described in the
  409. .Sx ENVIRONMENT VARIABLES
  410. section.
  411. .Pp
  412. It is possible to have multiple certificate files specified in
  413. configuration files; these certificates will be tried in sequence.
  414. Multiple
  415. .Cm CertificateFile
  416. directives will add to the list of certificates used for
  417. authentication.
  418. .It Cm ChallengeResponseAuthentication
  419. Specifies whether to use challenge-response authentication.
  420. The argument to this keyword must be
  421. .Cm yes
  422. (the default)
  423. or
  424. .Cm no .
  425. .It Cm CheckHostIP
  426. If set to
  427. .Cm yes
  428. .Xr ssh 1
  429. will additionally check the host IP address in the
  430. .Pa known_hosts
  431. file.
  432. This allows it to detect if a host key changed due to DNS spoofing
  433. and will add addresses of destination hosts to
  434. .Pa ~/.ssh/known_hosts
  435. in the process, regardless of the setting of
  436. .Cm StrictHostKeyChecking .
  437. If the option is set to
  438. .Cm no
  439. (the default),
  440. the check will not be executed.
  441. .It Cm Ciphers
  442. Specifies the ciphers allowed and their order of preference.
  443. Multiple ciphers must be comma-separated.
  444. If the specified list begins with a
  445. .Sq +
  446. character, then the specified ciphers will be appended to the default set
  447. instead of replacing them.
  448. If the specified list begins with a
  449. .Sq -
  450. character, then the specified ciphers (including wildcards) will be removed
  451. from the default set instead of replacing them.
  452. If the specified list begins with a
  453. .Sq ^
  454. character, then the specified ciphers will be placed at the head of the
  455. default set.
  456. .Pp
  457. The supported ciphers are:
  458. .Bd -literal -offset indent
  459. 3des-cbc
  460. aes128-cbc
  461. aes192-cbc
  462. aes256-cbc
  463. aes128-ctr
  464. aes192-ctr
  465. aes256-ctr
  466. aes128-gcm@openssh.com
  467. aes256-gcm@openssh.com
  468. chacha20-poly1305@openssh.com
  469. .Ed
  470. .Pp
  471. The default is:
  472. .Bd -literal -offset indent
  473. chacha20-poly1305@openssh.com,
  474. aes128-ctr,aes192-ctr,aes256-ctr,
  475. aes128-gcm@openssh.com,aes256-gcm@openssh.com
  476. .Ed
  477. .Pp
  478. The list of available ciphers may also be obtained using
  479. .Qq ssh -Q cipher .
  480. .It Cm ClearAllForwardings
  481. Specifies that all local, remote, and dynamic port forwardings
  482. specified in the configuration files or on the command line be
  483. cleared.
  484. This option is primarily useful when used from the
  485. .Xr ssh 1
  486. command line to clear port forwardings set in
  487. configuration files, and is automatically set by
  488. .Xr scp 1
  489. and
  490. .Xr sftp 1 .
  491. The argument must be
  492. .Cm yes
  493. or
  494. .Cm no
  495. (the default).
  496. .It Cm Compression
  497. Specifies whether to use compression.
  498. The argument must be
  499. .Cm yes
  500. or
  501. .Cm no
  502. (the default).
  503. .It Cm ConnectionAttempts
  504. Specifies the number of tries (one per second) to make before exiting.
  505. The argument must be an integer.
  506. This may be useful in scripts if the connection sometimes fails.
  507. The default is 1.
  508. .It Cm ConnectTimeout
  509. Specifies the timeout (in seconds) used when connecting to the
  510. SSH server, instead of using the default system TCP timeout.
  511. This timeout is applied both to establishing the connection and to performing
  512. the initial SSH protocol handshake and key exchange.
  513. .It Cm ControlMaster
  514. Enables the sharing of multiple sessions over a single network connection.
  515. When set to
  516. .Cm yes ,
  517. .Xr ssh 1
  518. will listen for connections on a control socket specified using the
  519. .Cm ControlPath
  520. argument.
  521. Additional sessions can connect to this socket using the same
  522. .Cm ControlPath
  523. with
  524. .Cm ControlMaster
  525. set to
  526. .Cm no
  527. (the default).
  528. These sessions will try to reuse the master instance's network connection
  529. rather than initiating new ones, but will fall back to connecting normally
  530. if the control socket does not exist, or is not listening.
  531. .Pp
  532. Setting this to
  533. .Cm ask
  534. will cause
  535. .Xr ssh 1
  536. to listen for control connections, but require confirmation using
  537. .Xr ssh-askpass 1 .
  538. If the
  539. .Cm ControlPath
  540. cannot be opened,
  541. .Xr ssh 1
  542. will continue without connecting to a master instance.
  543. .Pp
  544. X11 and
  545. .Xr ssh-agent 1
  546. forwarding is supported over these multiplexed connections, however the
  547. display and agent forwarded will be the one belonging to the master
  548. connection i.e. it is not possible to forward multiple displays or agents.
  549. .Pp
  550. Two additional options allow for opportunistic multiplexing: try to use a
  551. master connection but fall back to creating a new one if one does not already
  552. exist.
  553. These options are:
  554. .Cm auto
  555. and
  556. .Cm autoask .
  557. The latter requires confirmation like the
  558. .Cm ask
  559. option.
  560. .It Cm ControlPath
  561. Specify the path to the control socket used for connection sharing as described
  562. in the
  563. .Cm ControlMaster
  564. section above or the string
  565. .Cm none
  566. to disable connection sharing.
  567. Arguments to
  568. .Cm ControlPath
  569. may use the tilde syntax to refer to a user's home directory,
  570. the tokens described in the
  571. .Sx TOKENS
  572. section and environment variables as described in the
  573. .Sx ENVIRONMENT VARIABLES
  574. section.
  575. It is recommended that any
  576. .Cm ControlPath
  577. used for opportunistic connection sharing include
  578. at least %h, %p, and %r (or alternatively %C) and be placed in a directory
  579. that is not writable by other users.
  580. This ensures that shared connections are uniquely identified.
  581. .It Cm ControlPersist
  582. When used in conjunction with
  583. .Cm ControlMaster ,
  584. specifies that the master connection should remain open
  585. in the background (waiting for future client connections)
  586. after the initial client connection has been closed.
  587. If set to
  588. .Cm no
  589. (the default),
  590. then the master connection will not be placed into the background,
  591. and will close as soon as the initial client connection is closed.
  592. If set to
  593. .Cm yes
  594. or 0,
  595. then the master connection will remain in the background indefinitely
  596. (until killed or closed via a mechanism such as the
  597. .Qq ssh -O exit ) .
  598. If set to a time in seconds, or a time in any of the formats documented in
  599. .Xr sshd_config 5 ,
  600. then the backgrounded master connection will automatically terminate
  601. after it has remained idle (with no client connections) for the
  602. specified time.
  603. .It Cm DynamicForward
  604. Specifies that a TCP port on the local machine be forwarded
  605. over the secure channel, and the application
  606. protocol is then used to determine where to connect to from the
  607. remote machine.
  608. .Pp
  609. The argument must be
  610. .Sm off
  611. .Oo Ar bind_address : Oc Ar port .
  612. .Sm on
  613. IPv6 addresses can be specified by enclosing addresses in square brackets.
  614. By default, the local port is bound in accordance with the
  615. .Cm GatewayPorts
  616. setting.
  617. However, an explicit
  618. .Ar bind_address
  619. may be used to bind the connection to a specific address.
  620. The
  621. .Ar bind_address
  622. of
  623. .Cm localhost
  624. indicates that the listening port be bound for local use only, while an
  625. empty address or
  626. .Sq *
  627. indicates that the port should be available from all interfaces.
  628. .Pp
  629. Currently the SOCKS4 and SOCKS5 protocols are supported, and
  630. .Xr ssh 1
  631. will act as a SOCKS server.
  632. Multiple forwardings may be specified, and
  633. additional forwardings can be given on the command line.
  634. Only the superuser can forward privileged ports.
  635. .It Cm EnableSSHKeysign
  636. Setting this option to
  637. .Cm yes
  638. in the global client configuration file
  639. .Pa /etc/ssh/ssh_config
  640. enables the use of the helper program
  641. .Xr ssh-keysign 8
  642. during
  643. .Cm HostbasedAuthentication .
  644. The argument must be
  645. .Cm yes
  646. or
  647. .Cm no
  648. (the default).
  649. This option should be placed in the non-hostspecific section.
  650. See
  651. .Xr ssh-keysign 8
  652. for more information.
  653. .It Cm EscapeChar
  654. Sets the escape character (default:
  655. .Ql ~ ) .
  656. The escape character can also
  657. be set on the command line.
  658. The argument should be a single character,
  659. .Ql ^
  660. followed by a letter, or
  661. .Cm none
  662. to disable the escape
  663. character entirely (making the connection transparent for binary
  664. data).
  665. .It Cm ExitOnForwardFailure
  666. Specifies whether
  667. .Xr ssh 1
  668. should terminate the connection if it cannot set up all requested
  669. dynamic, tunnel, local, and remote port forwardings, (e.g.\&
  670. if either end is unable to bind and listen on a specified port).
  671. Note that
  672. .Cm ExitOnForwardFailure
  673. does not apply to connections made over port forwardings and will not,
  674. for example, cause
  675. .Xr ssh 1
  676. to exit if TCP connections to the ultimate forwarding destination fail.
  677. The argument must be
  678. .Cm yes
  679. or
  680. .Cm no
  681. (the default).
  682. .It Cm FingerprintHash
  683. Specifies the hash algorithm used when displaying key fingerprints.
  684. Valid options are:
  685. .Cm md5
  686. and
  687. .Cm sha256
  688. (the default).
  689. .It Cm ForkAfterAuthentication
  690. Requests
  691. .Nm ssh
  692. to go to background just before command execution.
  693. This is useful if
  694. .Nm ssh
  695. is going to ask for passwords or passphrases, but the user
  696. wants it in the background.
  697. This implies the
  698. .Cm StdinNull
  699. configuration option being set to
  700. .Dq yes .
  701. The recommended way to start X11 programs at a remote site is with
  702. something like
  703. .Ic ssh -f host xterm ,
  704. which is the same as
  705. .Ic ssh host xterm
  706. if the
  707. .Cm ForkAfterAuthentication
  708. configuration option is set to
  709. .Dq yes .
  710. .Pp
  711. If the
  712. .Cm ExitOnForwardFailure
  713. configuration option is set to
  714. .Dq yes ,
  715. then a client started with the
  716. .Cm ForkAfterAuthentication
  717. configuration option being set to
  718. .Dq yes
  719. will wait for all remote port forwards to be successfully established
  720. before placing itself in the background.
  721. The argument to this keyword must be
  722. .Cm yes
  723. (same as the
  724. .Fl f
  725. option) or
  726. .Cm no
  727. (the default).
  728. .It Cm ForwardAgent
  729. Specifies whether the connection to the authentication agent (if any)
  730. will be forwarded to the remote machine.
  731. The argument may be
  732. .Cm yes ,
  733. .Cm no
  734. (the default),
  735. an explicit path to an agent socket or the name of an environment variable
  736. (beginning with
  737. .Sq $ )
  738. in which to find the path.
  739. .Pp
  740. Agent forwarding should be enabled with caution.
  741. Users with the ability to bypass file permissions on the remote host
  742. (for the agent's Unix-domain socket)
  743. can access the local agent through the forwarded connection.
  744. An attacker cannot obtain key material from the agent,
  745. however they can perform operations on the keys that enable them to
  746. authenticate using the identities loaded into the agent.
  747. .It Cm ForwardX11
  748. Specifies whether X11 connections will be automatically redirected
  749. over the secure channel and
  750. .Ev DISPLAY
  751. set.
  752. The argument must be
  753. .Cm yes
  754. or
  755. .Cm no
  756. (the default).
  757. .Pp
  758. X11 forwarding should be enabled with caution.
  759. Users with the ability to bypass file permissions on the remote host
  760. (for the user's X11 authorization database)
  761. can access the local X11 display through the forwarded connection.
  762. An attacker may then be able to perform activities such as keystroke monitoring
  763. if the
  764. .Cm ForwardX11Trusted
  765. option is also enabled.
  766. .It Cm ForwardX11Timeout
  767. Specify a timeout for untrusted X11 forwarding
  768. using the format described in the
  769. .Sx TIME FORMATS
  770. section of
  771. .Xr sshd_config 5 .
  772. X11 connections received by
  773. .Xr ssh 1
  774. after this time will be refused.
  775. Setting
  776. .Cm ForwardX11Timeout
  777. to zero will disable the timeout and permit X11 forwarding for the life
  778. of the connection.
  779. The default is to disable untrusted X11 forwarding after twenty minutes has
  780. elapsed.
  781. .It Cm ForwardX11Trusted
  782. If this option is set to
  783. .Cm yes ,
  784. remote X11 clients will have full access to the original X11 display.
  785. .Pp
  786. If this option is set to
  787. .Cm no
  788. (the default),
  789. remote X11 clients will be considered untrusted and prevented
  790. from stealing or tampering with data belonging to trusted X11
  791. clients.
  792. Furthermore, the
  793. .Xr xauth 1
  794. token used for the session will be set to expire after 20 minutes.
  795. Remote clients will be refused access after this time.
  796. .Pp
  797. See the X11 SECURITY extension specification for full details on
  798. the restrictions imposed on untrusted clients.
  799. .It Cm GatewayPorts
  800. Specifies whether remote hosts are allowed to connect to local
  801. forwarded ports.
  802. By default,
  803. .Xr ssh 1
  804. binds local port forwardings to the loopback address.
  805. This prevents other remote hosts from connecting to forwarded ports.
  806. .Cm GatewayPorts
  807. can be used to specify that ssh
  808. should bind local port forwardings to the wildcard address,
  809. thus allowing remote hosts to connect to forwarded ports.
  810. The argument must be
  811. .Cm yes
  812. or
  813. .Cm no
  814. (the default).
  815. .It Cm GlobalKnownHostsFile
  816. Specifies one or more files to use for the global
  817. host key database, separated by whitespace.
  818. The default is
  819. .Pa /etc/ssh/ssh_known_hosts ,
  820. .Pa /etc/ssh/ssh_known_hosts2 .
  821. .It Cm GSSAPIAuthentication
  822. Specifies whether user authentication based on GSSAPI is allowed.
  823. The default is
  824. .Cm no .
  825. .It Cm GSSAPIDelegateCredentials
  826. Forward (delegate) credentials to the server.
  827. The default is
  828. .Cm no .
  829. .It Cm HashKnownHosts
  830. Indicates that
  831. .Xr ssh 1
  832. should hash host names and addresses when they are added to
  833. .Pa ~/.ssh/known_hosts .
  834. These hashed names may be used normally by
  835. .Xr ssh 1
  836. and
  837. .Xr sshd 8 ,
  838. but they do not visually reveal identifying information if the
  839. file's contents are disclosed.
  840. The default is
  841. .Cm no .
  842. Note that existing names and addresses in known hosts files
  843. will not be converted automatically,
  844. but may be manually hashed using
  845. .Xr ssh-keygen 1 .
  846. Use of this option may break facilities such as tab-completion that rely
  847. on being able to read unhashed host names from
  848. .Pa ~/.ssh/known_hosts .
  849. .It Cm HostbasedAcceptedAlgorithms
  850. Specifies the signature algorithms that will be used for hostbased
  851. authentication as a comma-separated list of patterns.
  852. Alternately if the specified list begins with a
  853. .Sq +
  854. character, then the specified signature algorithms will be appended
  855. to the default set instead of replacing them.
  856. If the specified list begins with a
  857. .Sq -
  858. character, then the specified signature algorithms (including wildcards)
  859. will be removed from the default set instead of replacing them.
  860. If the specified list begins with a
  861. .Sq ^
  862. character, then the specified signature algorithms will be placed
  863. at the head of the default set.
  864. The default for this option is:
  865. .Bd -literal -offset 3n
  866. ssh-ed25519-cert-v01@openssh.com,
  867. ecdsa-sha2-nistp256-cert-v01@openssh.com,
  868. ecdsa-sha2-nistp384-cert-v01@openssh.com,
  869. ecdsa-sha2-nistp521-cert-v01@openssh.com,
  870. sk-ssh-ed25519-cert-v01@openssh.com,
  871. sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
  872. rsa-sha2-512-cert-v01@openssh.com,
  873. rsa-sha2-256-cert-v01@openssh.com,
  874. ssh-rsa-cert-v01@openssh.com,
  875. ssh-ed25519,
  876. ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  877. sk-ecdsa-sha2-nistp256@openssh.com,
  878. sk-ssh-ed25519@openssh.com,
  879. rsa-sha2-512,rsa-sha2-256,ssh-rsa
  880. .Ed
  881. .Pp
  882. The
  883. .Fl Q
  884. option of
  885. .Xr ssh 1
  886. may be used to list supported signature algorithms.
  887. This was formerly named HostbasedKeyTypes.
  888. .It Cm HostbasedAuthentication
  889. Specifies whether to try rhosts based authentication with public key
  890. authentication.
  891. The argument must be
  892. .Cm yes
  893. or
  894. .Cm no
  895. (the default).
  896. .It Cm HostKeyAlgorithms
  897. Specifies the host key signature algorithms
  898. that the client wants to use in order of preference.
  899. Alternately if the specified list begins with a
  900. .Sq +
  901. character, then the specified signature algorithms will be appended to
  902. the default set instead of replacing them.
  903. If the specified list begins with a
  904. .Sq -
  905. character, then the specified signature algorithms (including wildcards)
  906. will be removed from the default set instead of replacing them.
  907. If the specified list begins with a
  908. .Sq ^
  909. character, then the specified signature algorithms will be placed
  910. at the head of the default set.
  911. The default for this option is:
  912. .Bd -literal -offset 3n
  913. ssh-ed25519-cert-v01@openssh.com,
  914. ecdsa-sha2-nistp256-cert-v01@openssh.com,
  915. ecdsa-sha2-nistp384-cert-v01@openssh.com,
  916. ecdsa-sha2-nistp521-cert-v01@openssh.com,
  917. sk-ssh-ed25519-cert-v01@openssh.com,
  918. sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
  919. rsa-sha2-512-cert-v01@openssh.com,
  920. rsa-sha2-256-cert-v01@openssh.com,
  921. ssh-rsa-cert-v01@openssh.com,
  922. ssh-ed25519,
  923. ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  924. sk-ssh-ed25519@openssh.com,
  925. sk-ecdsa-sha2-nistp256@openssh.com,
  926. rsa-sha2-512,rsa-sha2-256,ssh-rsa
  927. .Ed
  928. .Pp
  929. If hostkeys are known for the destination host then this default is modified
  930. to prefer their algorithms.
  931. .Pp
  932. The list of available signature algorithms may also be obtained using
  933. .Qq ssh -Q HostKeyAlgorithms .
  934. .It Cm HostKeyAlias
  935. Specifies an alias that should be used instead of the
  936. real host name when looking up or saving the host key
  937. in the host key database files and when validating host certificates.
  938. This option is useful for tunneling SSH connections
  939. or for multiple servers running on a single host.
  940. .It Cm Hostname
  941. Specifies the real host name to log into.
  942. This can be used to specify nicknames or abbreviations for hosts.
  943. Arguments to
  944. .Cm Hostname
  945. accept the tokens described in the
  946. .Sx TOKENS
  947. section.
  948. Numeric IP addresses are also permitted (both on the command line and in
  949. .Cm Hostname
  950. specifications).
  951. The default is the name given on the command line.
  952. .It Cm IdentitiesOnly
  953. Specifies that
  954. .Xr ssh 1
  955. should only use the configured authentication identity and certificate files
  956. (either the default files, or those explicitly configured in the
  957. .Nm
  958. files
  959. or passed on the
  960. .Xr ssh 1
  961. command-line),
  962. even if
  963. .Xr ssh-agent 1
  964. or a
  965. .Cm PKCS11Provider
  966. or
  967. .Cm SecurityKeyProvider
  968. offers more identities.
  969. The argument to this keyword must be
  970. .Cm yes
  971. or
  972. .Cm no
  973. (the default).
  974. This option is intended for situations where ssh-agent
  975. offers many different identities.
  976. .It Cm IdentityAgent
  977. Specifies the
  978. .Ux Ns -domain
  979. socket used to communicate with the authentication agent.
  980. .Pp
  981. This option overrides the
  982. .Ev SSH_AUTH_SOCK
  983. environment variable and can be used to select a specific agent.
  984. Setting the socket name to
  985. .Cm none
  986. disables the use of an authentication agent.
  987. If the string
  988. .Qq SSH_AUTH_SOCK
  989. is specified, the location of the socket will be read from the
  990. .Ev SSH_AUTH_SOCK
  991. environment variable.
  992. Otherwise if the specified value begins with a
  993. .Sq $
  994. character, then it will be treated as an environment variable containing
  995. the location of the socket.
  996. .Pp
  997. Arguments to
  998. .Cm IdentityAgent
  999. may use the tilde syntax to refer to a user's home directory,
  1000. the tokens described in the
  1001. .Sx TOKENS
  1002. section and environment variables as described in the
  1003. .Sx ENVIRONMENT VARIABLES
  1004. section.
  1005. .It Cm IdentityFile
  1006. Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA,
  1007. Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read.
  1008. The default is
  1009. .Pa ~/.ssh/id_dsa ,
  1010. .Pa ~/.ssh/id_ecdsa ,
  1011. .Pa ~/.ssh/id_ecdsa_sk ,
  1012. .Pa ~/.ssh/id_ed25519 ,
  1013. .Pa ~/.ssh/id_ed25519_sk
  1014. and
  1015. .Pa ~/.ssh/id_rsa .
  1016. Additionally, any identities represented by the authentication agent
  1017. will be used for authentication unless
  1018. .Cm IdentitiesOnly
  1019. is set.
  1020. If no certificates have been explicitly specified by
  1021. .Cm CertificateFile ,
  1022. .Xr ssh 1
  1023. will try to load certificate information from the filename obtained by
  1024. appending
  1025. .Pa -cert.pub
  1026. to the path of a specified
  1027. .Cm IdentityFile .
  1028. .Pp
  1029. Arguments to
  1030. .Cm IdentityFile
  1031. may use the tilde syntax to refer to a user's home directory
  1032. or the tokens described in the
  1033. .Sx TOKENS
  1034. section.
  1035. .Pp
  1036. It is possible to have
  1037. multiple identity files specified in configuration files; all these
  1038. identities will be tried in sequence.
  1039. Multiple
  1040. .Cm IdentityFile
  1041. directives will add to the list of identities tried (this behaviour
  1042. differs from that of other configuration directives).
  1043. .Pp
  1044. .Cm IdentityFile
  1045. may be used in conjunction with
  1046. .Cm IdentitiesOnly
  1047. to select which identities in an agent are offered during authentication.
  1048. .Cm IdentityFile
  1049. may also be used in conjunction with
  1050. .Cm CertificateFile
  1051. in order to provide any certificate also needed for authentication with
  1052. the identity.
  1053. .Pp
  1054. The authentication identity can be also specified in a form of PKCS#11 URI
  1055. starting with a string
  1056. .Cm pkcs11: .
  1057. There is supported a subset of the PKCS#11 URI as defined
  1058. in RFC 7512 (implemented path arguments
  1059. .Cm id ,
  1060. .Cm manufacturer ,
  1061. .Cm object ,
  1062. .Cm token
  1063. and query arguments
  1064. .Cm module-path
  1065. and
  1066. .Cm pin-value
  1067. ). The URI can not be in quotes.
  1068. .It Cm IgnoreUnknown
  1069. Specifies a pattern-list of unknown options to be ignored if they are
  1070. encountered in configuration parsing.
  1071. This may be used to suppress errors if
  1072. .Nm
  1073. contains options that are unrecognised by
  1074. .Xr ssh 1 .
  1075. It is recommended that
  1076. .Cm IgnoreUnknown
  1077. be listed early in the configuration file as it will not be applied
  1078. to unknown options that appear before it.
  1079. .It Cm Include
  1080. Include the specified configuration file(s).
  1081. Multiple pathnames may be specified and each pathname may contain
  1082. .Xr glob 7
  1083. wildcards and, for user configurations, shell-like
  1084. .Sq ~
  1085. references to user home directories.
  1086. Wildcards will be expanded and processed in lexical order.
  1087. Files without absolute paths are assumed to be in
  1088. .Pa ~/.ssh
  1089. if included in a user configuration file or
  1090. .Pa /etc/ssh
  1091. if included from the system configuration file.
  1092. .Cm Include
  1093. directive may appear inside a
  1094. .Cm Match
  1095. or
  1096. .Cm Host
  1097. block
  1098. to perform conditional inclusion.
  1099. .It Cm IPQoS
  1100. Specifies the IPv4 type-of-service or DSCP class for connections.
  1101. Accepted values are
  1102. .Cm af11 ,
  1103. .Cm af12 ,
  1104. .Cm af13 ,
  1105. .Cm af21 ,
  1106. .Cm af22 ,
  1107. .Cm af23 ,
  1108. .Cm af31 ,
  1109. .Cm af32 ,
  1110. .Cm af33 ,
  1111. .Cm af41 ,
  1112. .Cm af42 ,
  1113. .Cm af43 ,
  1114. .Cm cs0 ,
  1115. .Cm cs1 ,
  1116. .Cm cs2 ,
  1117. .Cm cs3 ,
  1118. .Cm cs4 ,
  1119. .Cm cs5 ,
  1120. .Cm cs6 ,
  1121. .Cm cs7 ,
  1122. .Cm ef ,
  1123. .Cm le ,
  1124. .Cm lowdelay ,
  1125. .Cm throughput ,
  1126. .Cm reliability ,
  1127. a numeric value, or
  1128. .Cm none
  1129. to use the operating system default.
  1130. This option may take one or two arguments, separated by whitespace.
  1131. If one argument is specified, it is used as the packet class unconditionally.
  1132. If two values are specified, the first is automatically selected for
  1133. interactive sessions and the second for non-interactive sessions.
  1134. The default is
  1135. .Cm lowdelay
  1136. for interactive sessions and
  1137. .Cm throughput
  1138. for non-interactive sessions.
  1139. .It Cm KbdInteractiveAuthentication
  1140. Specifies whether to use keyboard-interactive authentication.
  1141. The argument to this keyword must be
  1142. .Cm yes
  1143. (the default)
  1144. or
  1145. .Cm no .
  1146. .It Cm KbdInteractiveDevices
  1147. Specifies the list of methods to use in keyboard-interactive authentication.
  1148. Multiple method names must be comma-separated.
  1149. The default is to use the server specified list.
  1150. The methods available vary depending on what the server supports.
  1151. For an OpenSSH server,
  1152. it may be zero or more of:
  1153. .Cm bsdauth
  1154. and
  1155. .Cm pam .
  1156. .It Cm KexAlgorithms
  1157. Specifies the available KEX (Key Exchange) algorithms.
  1158. Multiple algorithms must be comma-separated.
  1159. If the specified list begins with a
  1160. .Sq +
  1161. character, then the specified methods will be appended to the default set
  1162. instead of replacing them.
  1163. If the specified list begins with a
  1164. .Sq -
  1165. character, then the specified methods (including wildcards) will be removed
  1166. from the default set instead of replacing them.
  1167. If the specified list begins with a
  1168. .Sq ^
  1169. character, then the specified methods will be placed at the head of the
  1170. default set.
  1171. The default is:
  1172. .Bd -literal -offset indent
  1173. curve25519-sha256,curve25519-sha256@libssh.org,
  1174. ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
  1175. diffie-hellman-group-exchange-sha256,
  1176. diffie-hellman-group16-sha512,
  1177. diffie-hellman-group18-sha512,
  1178. diffie-hellman-group14-sha256
  1179. .Ed
  1180. .Pp
  1181. The list of available key exchange algorithms may also be obtained using
  1182. .Qq ssh -Q kex .
  1183. .It Cm LocalCommand
  1184. Specifies a command to execute on the local machine after successfully
  1185. connecting to the server.
  1186. The command string extends to the end of the line, and is executed with
  1187. the user's shell.
  1188. Arguments to
  1189. .Cm LocalCommand
  1190. accept the tokens described in the
  1191. .Sx TOKENS
  1192. section.
  1193. .Pp
  1194. The command is run synchronously and does not have access to the
  1195. session of the
  1196. .Xr ssh 1
  1197. that spawned it.
  1198. It should not be used for interactive commands.
  1199. .Pp
  1200. This directive is ignored unless
  1201. .Cm PermitLocalCommand
  1202. has been enabled.
  1203. .It Cm LocalForward
  1204. Specifies that a TCP port on the local machine be forwarded over
  1205. the secure channel to the specified host and port from the remote machine.
  1206. The first argument specifies the listener and may be
  1207. .Sm off
  1208. .Oo Ar bind_address : Oc Ar port
  1209. .Sm on
  1210. or a Unix domain socket path.
  1211. The second argument is the destination and may be
  1212. .Ar host : Ns Ar hostport
  1213. or a Unix domain socket path if the remote host supports it.
  1214. .Pp
  1215. IPv6 addresses can be specified by enclosing addresses in square brackets.
  1216. Multiple forwardings may be specified, and additional forwardings can be
  1217. given on the command line.
  1218. Only the superuser can forward privileged ports.
  1219. By default, the local port is bound in accordance with the
  1220. .Cm GatewayPorts
  1221. setting.
  1222. However, an explicit
  1223. .Ar bind_address
  1224. may be used to bind the connection to a specific address.
  1225. The
  1226. .Ar bind_address
  1227. of
  1228. .Cm localhost
  1229. indicates that the listening port be bound for local use only, while an
  1230. empty address or
  1231. .Sq *
  1232. indicates that the port should be available from all interfaces.
  1233. Unix domain socket paths may use the tokens described in the
  1234. .Sx TOKENS
  1235. section and environment variables as described in the
  1236. .Sx ENVIRONMENT VARIABLES
  1237. section.
  1238. .It Cm LogLevel
  1239. Gives the verbosity level that is used when logging messages from
  1240. .Xr ssh 1 .
  1241. The possible values are:
  1242. QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
  1243. The default is INFO.
  1244. DEBUG and DEBUG1 are equivalent.
  1245. DEBUG2 and DEBUG3 each specify higher levels of verbose output.
  1246. .It Cm MACs
  1247. Specifies the MAC (message authentication code) algorithms
  1248. in order of preference.
  1249. The MAC algorithm is used for data integrity protection.
  1250. Multiple algorithms must be comma-separated.
  1251. If the specified list begins with a
  1252. .Sq +
  1253. character, then the specified algorithms will be appended to the default set
  1254. instead of replacing them.
  1255. If the specified list begins with a
  1256. .Sq -
  1257. character, then the specified algorithms (including wildcards) will be removed
  1258. from the default set instead of replacing them.
  1259. If the specified list begins with a
  1260. .Sq ^
  1261. character, then the specified algorithms will be placed at the head of the
  1262. default set.
  1263. .Pp
  1264. The algorithms that contain
  1265. .Qq -etm
  1266. calculate the MAC after encryption (encrypt-then-mac).
  1267. These are considered safer and their use recommended.
  1268. .Pp
  1269. The default is:
  1270. .Bd -literal -offset indent
  1271. umac-64-etm@openssh.com,umac-128-etm@openssh.com,
  1272. hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
  1273. hmac-sha1-etm@openssh.com,
  1274. umac-64@openssh.com,umac-128@openssh.com,
  1275. hmac-sha2-256,hmac-sha2-512,hmac-sha1
  1276. .Ed
  1277. .Pp
  1278. The list of available MAC algorithms may also be obtained using
  1279. .Qq ssh -Q mac .
  1280. .It Cm NoHostAuthenticationForLocalhost
  1281. Disable host authentication for localhost (loopback addresses).
  1282. The argument to this keyword must be
  1283. .Cm yes
  1284. or
  1285. .Cm no
  1286. (the default).
  1287. .It Cm NoShell
  1288. Do not execute a remote command.
  1289. This is useful for just forwarding ports.
  1290. The argument to this keyword must be
  1291. .Cm yes
  1292. (same as the
  1293. .Fl N
  1294. option) or
  1295. .Cm no
  1296. (the default).
  1297. .It Cm NumberOfPasswordPrompts
  1298. Specifies the number of password prompts before giving up.
  1299. The argument to this keyword must be an integer.
  1300. The default is 3.
  1301. .It Cm PasswordAuthentication
  1302. Specifies whether to use password authentication.
  1303. The argument to this keyword must be
  1304. .Cm yes
  1305. (the default)
  1306. or
  1307. .Cm no .
  1308. .It Cm PermitLocalCommand
  1309. Allow local command execution via the
  1310. .Ic LocalCommand
  1311. option or using the
  1312. .Ic !\& Ns Ar command
  1313. escape sequence in
  1314. .Xr ssh 1 .
  1315. The argument must be
  1316. .Cm yes
  1317. or
  1318. .Cm no
  1319. (the default).
  1320. .It Cm PermitRemoteOpen
  1321. Specifies the destinations to which remote TCP port forwarding is permitted when
  1322. .Cm RemoteForward
  1323. is used as a SOCKS proxy.
  1324. The forwarding specification must be one of the following forms:
  1325. .Pp
  1326. .Bl -item -offset indent -compact
  1327. .It
  1328. .Cm PermitRemoteOpen
  1329. .Sm off
  1330. .Ar host : port
  1331. .Sm on
  1332. .It
  1333. .Cm PermitRemoteOpen
  1334. .Sm off
  1335. .Ar IPv4_addr : port
  1336. .Sm on
  1337. .It
  1338. .Cm PermitRemoteOpen
  1339. .Sm off
  1340. .Ar \&[ IPv6_addr \&] : port
  1341. .Sm on
  1342. .El
  1343. .Pp
  1344. Multiple forwards may be specified by separating them with whitespace.
  1345. An argument of
  1346. .Cm any
  1347. can be used to remove all restrictions and permit any forwarding requests.
  1348. An argument of
  1349. .Cm none
  1350. can be used to prohibit all forwarding requests.
  1351. The wildcard
  1352. .Sq *
  1353. can be used for host or port to allow all hosts or ports respectively.
  1354. Otherwise, no pattern matching or address lookups are performed on supplied
  1355. names.
  1356. .It Cm PKCS11Provider
  1357. Specifies which PKCS#11 provider to use or
  1358. .Cm none
  1359. to indicate that no provider should be used (the default).
  1360. The argument to this keyword is a path to the PKCS#11 shared library
  1361. .Xr ssh 1
  1362. should use to communicate with a PKCS#11 token providing keys for user
  1363. authentication.
  1364. .It Cm Port
  1365. Specifies the port number to connect on the remote host.
  1366. The default is 22.
  1367. .It Cm PreferredAuthentications
  1368. Specifies the order in which the client should try authentication methods.
  1369. This allows a client to prefer one method (e.g.\&
  1370. .Cm keyboard-interactive )
  1371. over another method (e.g.\&
  1372. .Cm password ) .
  1373. The default is:
  1374. .Bd -literal -offset indent
  1375. gssapi-with-mic,hostbased,publickey,
  1376. keyboard-interactive,password
  1377. .Ed
  1378. .It Cm ProxyCommand
  1379. Specifies the command to use to connect to the server.
  1380. The command
  1381. string extends to the end of the line, and is executed
  1382. using the user's shell
  1383. .Ql exec
  1384. directive to avoid a lingering shell process.
  1385. .Pp
  1386. Arguments to
  1387. .Cm ProxyCommand
  1388. accept the tokens described in the
  1389. .Sx TOKENS
  1390. section.
  1391. The command can be basically anything,
  1392. and should read from its standard input and write to its standard output.
  1393. It should eventually connect an
  1394. .Xr sshd 8
  1395. server running on some machine, or execute
  1396. .Ic sshd -i
  1397. somewhere.
  1398. Host key management will be done using the
  1399. .Cm Hostname
  1400. of the host being connected (defaulting to the name typed by the user).
  1401. Setting the command to
  1402. .Cm none
  1403. disables this option entirely.
  1404. Note that
  1405. .Cm CheckHostIP
  1406. is not available for connects with a proxy command.
  1407. .Pp
  1408. This directive is useful in conjunction with
  1409. .Xr nc 1
  1410. and its proxy support.
  1411. For example, the following directive would connect via an HTTP proxy at
  1412. 192.0.2.0:
  1413. .Bd -literal -offset 3n
  1414. ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p
  1415. .Ed
  1416. .It Cm ProxyJump
  1417. Specifies one or more jump proxies as either
  1418. .Xo
  1419. .Sm off
  1420. .Op Ar user No @
  1421. .Ar host
  1422. .Op : Ns Ar port
  1423. .Sm on
  1424. or an ssh URI
  1425. .Xc .
  1426. Multiple proxies may be separated by comma characters and will be visited
  1427. sequentially.
  1428. Setting this option will cause
  1429. .Xr ssh 1
  1430. to connect to the target host by first making a
  1431. .Xr ssh 1
  1432. connection to the specified
  1433. .Cm ProxyJump
  1434. host and then establishing a
  1435. TCP forwarding to the ultimate target from there.
  1436. Setting the host to
  1437. .Cm none
  1438. disables this option entirely.
  1439. .Pp
  1440. Note that this option will compete with the
  1441. .Cm ProxyCommand
  1442. option - whichever is specified first will prevent later instances of the
  1443. other from taking effect.
  1444. .Pp
  1445. Note also that the configuration for the destination host (either supplied
  1446. via the command-line or the configuration file) is not generally applied
  1447. to jump hosts.
  1448. .Pa ~/.ssh/config
  1449. should be used if specific configuration is required for jump hosts.
  1450. .It Cm ProxyUseFdpass
  1451. Specifies that
  1452. .Cm ProxyCommand
  1453. will pass a connected file descriptor back to
  1454. .Xr ssh 1
  1455. instead of continuing to execute and pass data.
  1456. The default is
  1457. .Cm no .
  1458. .It Cm PubkeyAcceptedAlgorithms
  1459. Specifies the signature algorithms that will be used for public key
  1460. authentication as a comma-separated list of patterns.
  1461. If the specified list begins with a
  1462. .Sq +
  1463. character, then the algorithms after it will be appended to the default
  1464. instead of replacing it.
  1465. If the specified list begins with a
  1466. .Sq -
  1467. character, then the specified algorithms (including wildcards) will be removed
  1468. from the default set instead of replacing them.
  1469. If the specified list begins with a
  1470. .Sq ^
  1471. character, then the specified algorithms will be placed at the head of the
  1472. default set.
  1473. The default for this option is:
  1474. .Bd -literal -offset 3n
  1475. ssh-ed25519-cert-v01@openssh.com,
  1476. ecdsa-sha2-nistp256-cert-v01@openssh.com,
  1477. ecdsa-sha2-nistp384-cert-v01@openssh.com,
  1478. ecdsa-sha2-nistp521-cert-v01@openssh.com,
  1479. sk-ssh-ed25519-cert-v01@openssh.com,
  1480. sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
  1481. rsa-sha2-512-cert-v01@openssh.com,
  1482. rsa-sha2-256-cert-v01@openssh.com,
  1483. ssh-rsa-cert-v01@openssh.com,
  1484. ssh-ed25519,
  1485. ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
  1486. sk-ssh-ed25519@openssh.com,
  1487. sk-ecdsa-sha2-nistp256@openssh.com,
  1488. rsa-sha2-512,rsa-sha2-256,ssh-rsa
  1489. .Ed
  1490. .Pp
  1491. The list of available signature algorithms may also be obtained using
  1492. .Qq ssh -Q PubkeyAcceptedAlgorithms .
  1493. .It Cm PubkeyAuthentication
  1494. Specifies whether to try public key authentication.
  1495. The argument to this keyword must be
  1496. .Cm yes
  1497. (the default)
  1498. or
  1499. .Cm no .
  1500. .It Cm RekeyLimit
  1501. Specifies the maximum amount of data that may be transmitted before the
  1502. session key is renegotiated, optionally followed by a maximum amount of
  1503. time that may pass before the session key is renegotiated.
  1504. The first argument is specified in bytes and may have a suffix of
  1505. .Sq K ,
  1506. .Sq M ,
  1507. or
  1508. .Sq G
  1509. to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
  1510. The default is between
  1511. .Sq 1G
  1512. and
  1513. .Sq 4G ,
  1514. depending on the cipher.
  1515. The optional second value is specified in seconds and may use any of the
  1516. units documented in the TIME FORMATS section of
  1517. .Xr sshd_config 5 .
  1518. The default value for
  1519. .Cm RekeyLimit
  1520. is
  1521. .Cm default none ,
  1522. which means that rekeying is performed after the cipher's default amount
  1523. of data has been sent or received and no time based rekeying is done.
  1524. .It Cm RemoteCommand
  1525. Specifies a command to execute on the remote machine after successfully
  1526. connecting to the server.
  1527. The command string extends to the end of the line, and is executed with
  1528. the user's shell.
  1529. Arguments to
  1530. .Cm RemoteCommand
  1531. accept the tokens described in the
  1532. .Sx TOKENS
  1533. section.
  1534. .It Cm RemoteForward
  1535. Specifies that a TCP port on the remote machine be forwarded over
  1536. the secure channel.
  1537. The remote port may either be forwarded to a specified host and port
  1538. from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote
  1539. client to connect to arbitrary destinations from the local machine.
  1540. The first argument is the listening specification and may be
  1541. .Sm off
  1542. .Oo Ar bind_address : Oc Ar port
  1543. .Sm on
  1544. or, if the remote host supports it, a Unix domain socket path.
  1545. If forwarding to a specific destination then the second argument must be
  1546. .Ar host : Ns Ar hostport
  1547. or a Unix domain socket path,
  1548. otherwise if no destination argument is specified then the remote forwarding
  1549. will be established as a SOCKS proxy.
  1550. When acting as a SOCKS proxy the destination of the connection can be
  1551. restricted by
  1552. .Cm PermitRemoteOpen .
  1553. .Pp
  1554. IPv6 addresses can be specified by enclosing addresses in square brackets.
  1555. Multiple forwardings may be specified, and additional
  1556. forwardings can be given on the command line.
  1557. Privileged ports can be forwarded only when
  1558. logging in as root on the remote machine.
  1559. Unix domain socket paths may use the tokens described in the
  1560. .Sx TOKENS
  1561. section and environment variables as described in the
  1562. .Sx ENVIRONMENT VARIABLES
  1563. section.
  1564. .Pp
  1565. If the
  1566. .Ar port
  1567. argument is 0,
  1568. the listen port will be dynamically allocated on the server and reported
  1569. to the client at run time.
  1570. .Pp
  1571. If the
  1572. .Ar bind_address
  1573. is not specified, the default is to only bind to loopback addresses.
  1574. If the
  1575. .Ar bind_address
  1576. is
  1577. .Ql *
  1578. or an empty string, then the forwarding is requested to listen on all
  1579. interfaces.
  1580. Specifying a remote
  1581. .Ar bind_address
  1582. will only succeed if the server's
  1583. .Cm GatewayPorts
  1584. option is enabled (see
  1585. .Xr sshd_config 5 ) .
  1586. .It Cm RequestTTY
  1587. Specifies whether to request a pseudo-tty for the session.
  1588. The argument may be one of:
  1589. .Cm no
  1590. (never request a TTY),
  1591. .Cm yes
  1592. (always request a TTY when standard input is a TTY),
  1593. .Cm force
  1594. (always request a TTY) or
  1595. .Cm auto
  1596. (request a TTY when opening a login session).
  1597. This option mirrors the
  1598. .Fl t
  1599. and
  1600. .Fl T
  1601. flags for
  1602. .Xr ssh 1 .
  1603. .It Cm RevokedHostKeys
  1604. Specifies revoked host public keys.
  1605. Keys listed in this file will be refused for host authentication.
  1606. Note that if this file does not exist or is not readable,
  1607. then host authentication will be refused for all hosts.
  1608. Keys may be specified as a text file, listing one public key per line, or as
  1609. an OpenSSH Key Revocation List (KRL) as generated by
  1610. .Xr ssh-keygen 1 .
  1611. For more information on KRLs, see the KEY REVOCATION LISTS section in
  1612. .Xr ssh-keygen 1 .
  1613. .It Cm SecurityKeyProvider
  1614. Specifies a path to a library that will be used when loading any
  1615. FIDO authenticator-hosted keys, overriding the default of using
  1616. the built-in USB HID support.
  1617. .Pp
  1618. If the specified value begins with a
  1619. .Sq $
  1620. character, then it will be treated as an environment variable containing
  1621. the path to the library.
  1622. .It Cm SendEnv
  1623. Specifies what variables from the local
  1624. .Xr environ 7
  1625. should be sent to the server.
  1626. The server must also support it, and the server must be configured to
  1627. accept these environment variables.
  1628. Note that the
  1629. .Ev TERM
  1630. environment variable is always sent whenever a
  1631. pseudo-terminal is requested as it is required by the protocol.
  1632. Refer to
  1633. .Cm AcceptEnv
  1634. in
  1635. .Xr sshd_config 5
  1636. for how to configure the server.
  1637. Variables are specified by name, which may contain wildcard characters.
  1638. Multiple environment variables may be separated by whitespace or spread
  1639. across multiple
  1640. .Cm SendEnv
  1641. directives.
  1642. .Pp
  1643. See
  1644. .Sx PATTERNS
  1645. for more information on patterns.
  1646. .Pp
  1647. It is possible to clear previously set
  1648. .Cm SendEnv
  1649. variable names by prefixing patterns with
  1650. .Pa - .
  1651. The default is not to send any environment variables.
  1652. .It Cm ServerAliveCountMax
  1653. Sets the number of server alive messages (see below) which may be
  1654. sent without
  1655. .Xr ssh 1
  1656. receiving any messages back from the server.
  1657. If this threshold is reached while server alive messages are being sent,
  1658. ssh will disconnect from the server, terminating the session.
  1659. It is important to note that the use of server alive messages is very
  1660. different from
  1661. .Cm TCPKeepAlive
  1662. (below).
  1663. The server alive messages are sent through the encrypted channel
  1664. and therefore will not be spoofable.
  1665. The TCP keepalive option enabled by
  1666. .Cm TCPKeepAlive
  1667. is spoofable.
  1668. The server alive mechanism is valuable when the client or
  1669. server depend on knowing when a connection has become unresponsive.
  1670. .Pp
  1671. The default value is 3.
  1672. If, for example,
  1673. .Cm ServerAliveInterval
  1674. (see below) is set to 15 and
  1675. .Cm ServerAliveCountMax
  1676. is left at the default, if the server becomes unresponsive,
  1677. ssh will disconnect after approximately 45 seconds.
  1678. .It Cm ServerAliveInterval
  1679. Sets a timeout interval in seconds after which if no data has been received
  1680. from the server,
  1681. .Xr ssh 1
  1682. will send a message through the encrypted
  1683. channel to request a response from the server.
  1684. The default
  1685. is 0, indicating that these messages will not be sent to the server,
  1686. or 300 if the
  1687. .Cm BatchMode
  1688. option is set (Debian-specific).
  1689. .Cm ProtocolKeepAlives
  1690. and
  1691. .Cm SetupTimeOut
  1692. are Debian-specific compatibility aliases for this option.
  1693. .It Cm SetEnv
  1694. Directly specify one or more environment variables and their contents to
  1695. be sent to the server.
  1696. Similarly to
  1697. .Cm SendEnv ,
  1698. the server must be prepared to accept the environment variable.
  1699. .It Cm StdinNull
  1700. Redirects stdin from
  1701. .Pa /dev/null
  1702. (actually, prevents reading from stdin).
  1703. This must be used when
  1704. .Nm ssh
  1705. is run in the background.
  1706. A common trick is to use this to run X11 programs on a remote machine.
  1707. For example,
  1708. .Ic ssh shadows.cs.hut.fi emacs &
  1709. will start an emacs on shadows.cs.hut.fi, and the X11
  1710. connection will be automatically forwarded over an encrypted channel.
  1711. The
  1712. .Nm ssh
  1713. program will be put in the background.
  1714. (This does not work if
  1715. .Nm ssh
  1716. needs to ask for a password or passphrase; see also the
  1717. .Cm ForkAfterAuthentication
  1718. configuration option.)
  1719. The argument to this keyword must be
  1720. .Cm yes
  1721. (same as the
  1722. .Fl n
  1723. option) or
  1724. .Cm no
  1725. (the default).
  1726. .It Cm StreamLocalBindMask
  1727. Sets the octal file creation mode mask
  1728. .Pq umask
  1729. used when creating a Unix-domain socket file for local or remote
  1730. port forwarding.
  1731. This option is only used for port forwarding to a Unix-domain socket file.
  1732. .Pp
  1733. The default value is 0177, which creates a Unix-domain socket file that is
  1734. readable and writable only by the owner.
  1735. Note that not all operating systems honor the file mode on Unix-domain
  1736. socket files.
  1737. .It Cm StreamLocalBindUnlink
  1738. Specifies whether to remove an existing Unix-domain socket file for local
  1739. or remote port forwarding before creating a new one.
  1740. If the socket file already exists and
  1741. .Cm StreamLocalBindUnlink
  1742. is not enabled,
  1743. .Nm ssh
  1744. will be unable to forward the port to the Unix-domain socket file.
  1745. This option is only used for port forwarding to a Unix-domain socket file.
  1746. .Pp
  1747. The argument must be
  1748. .Cm yes
  1749. or
  1750. .Cm no
  1751. (the default).
  1752. .It Cm StrictHostKeyChecking
  1753. If this flag is set to
  1754. .Cm yes ,
  1755. .Xr ssh 1
  1756. will never automatically add host keys to the
  1757. .Pa ~/.ssh/known_hosts
  1758. file, and refuses to connect to hosts whose host key has changed.
  1759. This provides maximum protection against man-in-the-middle (MITM) attacks,
  1760. though it can be annoying when the
  1761. .Pa /etc/ssh/ssh_known_hosts
  1762. file is poorly maintained or when connections to new hosts are
  1763. frequently made.
  1764. This option forces the user to manually
  1765. add all new hosts.
  1766. .Pp
  1767. If this flag is set to
  1768. .Dq accept-new
  1769. then ssh will automatically add new host keys to the user
  1770. known hosts files, but will not permit connections to hosts with
  1771. changed host keys.
  1772. If this flag is set to
  1773. .Dq no
  1774. or
  1775. .Dq off ,
  1776. ssh will automatically add new host keys to the user known hosts files
  1777. and allow connections to hosts with changed hostkeys to proceed,
  1778. subject to some restrictions.
  1779. If this flag is set to
  1780. .Cm ask
  1781. (the default),
  1782. new host keys
  1783. will be added to the user known host files only after the user
  1784. has confirmed that is what they really want to do, and
  1785. ssh will refuse to connect to hosts whose host key has changed.
  1786. The host keys of
  1787. known hosts will be verified automatically in all cases.
  1788. .It Cm SyslogFacility
  1789. Gives the facility code that is used when logging messages from
  1790. .Xr ssh 1 .
  1791. The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
  1792. LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
  1793. The default is USER.
  1794. .It Cm TCPKeepAlive
  1795. Specifies whether the system should send TCP keepalive messages to the
  1796. other side.
  1797. If they are sent, death of the connection or crash of one
  1798. of the machines will be properly noticed.
  1799. This option only uses TCP keepalives (as opposed to using ssh level
  1800. keepalives), so takes a long time to notice when the connection dies.
  1801. As such, you probably want
  1802. the
  1803. .Cm ServerAliveInterval
  1804. option as well.
  1805. However, this means that
  1806. connections will die if the route is down temporarily, and some people
  1807. find it annoying.
  1808. .Pp
  1809. The default is
  1810. .Cm yes
  1811. (to send TCP keepalive messages), and the client will notice
  1812. if the network goes down or the remote host dies.
  1813. This is important in scripts, and many users want it too.
  1814. .Pp
  1815. To disable TCP keepalive messages, the value should be set to
  1816. .Cm no .
  1817. See also
  1818. .Cm ServerAliveInterval
  1819. for protocol-level keepalives.
  1820. .It Cm Tunnel
  1821. Request
  1822. .Xr tun 4
  1823. device forwarding between the client and the server.
  1824. The argument must be
  1825. .Cm yes ,
  1826. .Cm point-to-point
  1827. (layer 3),
  1828. .Cm ethernet
  1829. (layer 2),
  1830. or
  1831. .Cm no
  1832. (the default).
  1833. Specifying
  1834. .Cm yes
  1835. requests the default tunnel mode, which is
  1836. .Cm point-to-point .
  1837. .It Cm TunnelDevice
  1838. Specifies the
  1839. .Xr tun 4
  1840. devices to open on the client
  1841. .Pq Ar local_tun
  1842. and the server
  1843. .Pq Ar remote_tun .
  1844. .Pp
  1845. The argument must be
  1846. .Sm off
  1847. .Ar local_tun Op : Ar remote_tun .
  1848. .Sm on
  1849. The devices may be specified by numerical ID or the keyword
  1850. .Cm any ,
  1851. which uses the next available tunnel device.
  1852. If
  1853. .Ar remote_tun
  1854. is not specified, it defaults to
  1855. .Cm any .
  1856. The default is
  1857. .Cm any:any .
  1858. .It Cm UpdateHostKeys
  1859. Specifies whether
  1860. .Xr ssh 1
  1861. should accept notifications of additional hostkeys from the server sent
  1862. after authentication has completed and add them to
  1863. .Cm UserKnownHostsFile .
  1864. The argument must be
  1865. .Cm yes ,
  1866. .Cm no
  1867. or
  1868. .Cm ask .
  1869. This option allows learning alternate hostkeys for a server
  1870. and supports graceful key rotation by allowing a server to send replacement
  1871. public keys before old ones are removed.
  1872. .Pp
  1873. Additional hostkeys are only accepted if the key used to authenticate the
  1874. host was already trusted or explicitly accepted by the user, the host was
  1875. authenticated via
  1876. .Cm UserKnownHostsFile
  1877. (i.e. not
  1878. .Cm GlobalKnownHostsFile )
  1879. and the host was authenticated using a plain key and not a certificate.
  1880. .Pp
  1881. .Cm UpdateHostKeys
  1882. is enabled by default if the user has not overridden the default
  1883. .Cm UserKnownHostsFile
  1884. setting and has not enabled
  1885. .Cm VerifyHostKeyDNS ,
  1886. otherwise
  1887. .Cm UpdateHostKeys
  1888. will be set to
  1889. .Cm no .
  1890. .Pp
  1891. If
  1892. .Cm UpdateHostKeys
  1893. is set to
  1894. .Cm ask ,
  1895. then the user is asked to confirm the modifications to the known_hosts file.
  1896. Confirmation is currently incompatible with
  1897. .Cm ControlPersist ,
  1898. and will be disabled if it is enabled.
  1899. .Pp
  1900. Presently, only
  1901. .Xr sshd 8
  1902. from OpenSSH 6.8 and greater support the
  1903. .Qq hostkeys@openssh.com
  1904. protocol extension used to inform the client of all the server's hostkeys.
  1905. .It Cm User
  1906. Specifies the user to log in as.
  1907. This can be useful when a different user name is used on different machines.
  1908. This saves the trouble of
  1909. having to remember to give the user name on the command line.
  1910. .It Cm UserKnownHostsFile
  1911. Specifies one or more files to use for the user
  1912. host key database, separated by whitespace.
  1913. Each filename may use tilde notation to refer to the user's home directory,
  1914. the tokens described in the
  1915. .Sx TOKENS
  1916. section and environment variables as described in the
  1917. .Sx ENVIRONMENT VARIABLES
  1918. section.
  1919. The default is
  1920. .Pa ~/.ssh/known_hosts ,
  1921. .Pa ~/.ssh/known_hosts2 .
  1922. .It Cm VerifyHostKeyDNS
  1923. Specifies whether to verify the remote key using DNS and SSHFP resource
  1924. records.
  1925. If this option is set to
  1926. .Cm yes ,
  1927. the client will implicitly trust keys that match a secure fingerprint
  1928. from DNS.
  1929. Insecure fingerprints will be handled as if this option was set to
  1930. .Cm ask .
  1931. If this option is set to
  1932. .Cm ask ,
  1933. information on fingerprint match will be displayed, but the user will still
  1934. need to confirm new host keys according to the
  1935. .Cm StrictHostKeyChecking
  1936. option.
  1937. The default is
  1938. .Cm no .
  1939. .Pp
  1940. See also
  1941. .Sx VERIFYING HOST KEYS
  1942. in
  1943. .Xr ssh 1 .
  1944. .It Cm VisualHostKey
  1945. If this flag is set to
  1946. .Cm yes ,
  1947. an ASCII art representation of the remote host key fingerprint is
  1948. printed in addition to the fingerprint string at login and
  1949. for unknown host keys.
  1950. If this flag is set to
  1951. .Cm no
  1952. (the default),
  1953. no fingerprint strings are printed at login and
  1954. only the fingerprint string will be printed for unknown host keys.
  1955. .It Cm XAuthLocation
  1956. Specifies the full pathname of the
  1957. .Xr xauth 1
  1958. program.
  1959. The default is
  1960. .Pa /usr/X11R6/bin/xauth .
  1961. .El
  1962. .Sh PATTERNS
  1963. A
  1964. .Em pattern
  1965. consists of zero or more non-whitespace characters,
  1966. .Sq *
  1967. (a wildcard that matches zero or more characters),
  1968. or
  1969. .Sq ?\&
  1970. (a wildcard that matches exactly one character).
  1971. For example, to specify a set of declarations for any host in the
  1972. .Qq .co.uk
  1973. set of domains,
  1974. the following pattern could be used:
  1975. .Pp
  1976. .Dl Host *.co.uk
  1977. .Pp
  1978. The following pattern
  1979. would match any host in the 192.168.0.[0-9] network range:
  1980. .Pp
  1981. .Dl Host 192.168.0.?
  1982. .Pp
  1983. A
  1984. .Em pattern-list
  1985. is a comma-separated list of patterns.
  1986. Patterns within pattern-lists may be negated
  1987. by preceding them with an exclamation mark
  1988. .Pq Sq !\& .
  1989. For example,
  1990. to allow a key to be used from anywhere within an organization
  1991. except from the
  1992. .Qq dialup
  1993. pool,
  1994. the following entry (in authorized_keys) could be used:
  1995. .Pp
  1996. .Dl from=\&"!*.dialup.example.com,*.example.com\&"
  1997. .Pp
  1998. Note that a negated match will never produce a positive result by itself.
  1999. For example, attempting to match
  2000. .Qq host3
  2001. against the following pattern-list will fail:
  2002. .Pp
  2003. .Dl from=\&"!host1,!host2\&"
  2004. .Pp
  2005. The solution here is to include a term that will yield a positive match,
  2006. such as a wildcard:
  2007. .Pp
  2008. .Dl from=\&"!host1,!host2,*\&"
  2009. .Sh TOKENS
  2010. Arguments to some keywords can make use of tokens,
  2011. which are expanded at runtime:
  2012. .Pp
  2013. .Bl -tag -width XXXX -offset indent -compact
  2014. .It %%
  2015. A literal
  2016. .Sq % .
  2017. .It \&%C
  2018. Hash of %l%h%p%r.
  2019. .It %d
  2020. Local user's home directory.
  2021. .It %h
  2022. The remote hostname.
  2023. .It %i
  2024. The local user ID.
  2025. .It %k
  2026. The host key alias if specified, otherwise the orignal remote hostname given
  2027. on the command line.
  2028. .It %L
  2029. The local hostname.
  2030. .It %l
  2031. The local hostname, including the domain name.
  2032. .It %n
  2033. The original remote hostname, as given on the command line.
  2034. .It %p
  2035. The remote port.
  2036. .It %r
  2037. The remote username.
  2038. .It \&%T
  2039. The local
  2040. .Xr tun 4
  2041. or
  2042. .Xr tap 4
  2043. network interface assigned if
  2044. tunnel forwarding was requested, or
  2045. .Qq NONE
  2046. otherwise.
  2047. .It %u
  2048. The local username.
  2049. .El
  2050. .Pp
  2051. .Cm CertificateFile ,
  2052. .Cm ControlPath ,
  2053. .Cm IdentityAgent ,
  2054. .Cm IdentityFile ,
  2055. .Cm LocalForward ,
  2056. .Cm Match exec ,
  2057. .Cm RemoteCommand ,
  2058. .Cm RemoteForward ,
  2059. and
  2060. .Cm UserKnownHostsFile
  2061. accept the tokens %%, %C, %d, %h, %i, %k, %L, %l, %n, %p, %r, and %u.
  2062. .Pp
  2063. .Cm Hostname
  2064. accepts the tokens %% and %h.
  2065. .Pp
  2066. .Cm LocalCommand
  2067. accepts all tokens.
  2068. .Pp
  2069. .Cm ProxyCommand
  2070. accepts the tokens %%, %h, %n, %p, and %r.
  2071. .Sh ENVIRONMENT VARIABLES
  2072. Arguments to some keywords can be expanded at runtime from environment
  2073. variables on the client by enclosing them in
  2074. .Ic ${} ,
  2075. for example
  2076. .Ic ${HOME}/.ssh
  2077. would refer to the user's .ssh directory.
  2078. If a specified environment variable does not exist then an error will be
  2079. returned and the setting for that keyword will be ignored.
  2080. .Pp
  2081. The keywords
  2082. .Cm CertificateFile ,
  2083. .Cm ControlPath ,
  2084. .Cm IdentityAgent ,
  2085. .Cm IdentityFile
  2086. and
  2087. .Cm UserKnownHostsFile
  2088. support environment variables.
  2089. The keywords
  2090. .Cm LocalForward
  2091. and
  2092. .Cm RemoteForward
  2093. support environment variables only for Unix domain socket paths.
  2094. .Sh FILES
  2095. .Bl -tag -width Ds
  2096. .It Pa ~/.ssh/config
  2097. This is the per-user configuration file.
  2098. The format of this file is described above.
  2099. This file is used by the SSH client.
  2100. Because of the potential for abuse, this file must have strict permissions:
  2101. read/write for the user, and not writable by others.
  2102. .It Pa /etc/ssh/ssh_config
  2103. Systemwide configuration file.
  2104. This file provides defaults for those
  2105. values that are not specified in the user's configuration file, and
  2106. for those users who do not have a configuration file.
  2107. This file must be world-readable.
  2108. .El
  2109. .Sh SEE ALSO
  2110. .Xr ssh 1
  2111. .Sh AUTHORS
  2112. .An -nosplit
  2113. OpenSSH is a derivative of the original and free
  2114. ssh 1.2.12 release by
  2115. .An Tatu Ylonen .
  2116. .An Aaron Campbell , Bob Beck , Markus Friedl ,
  2117. .An Niels Provos , Theo de Raadt
  2118. and
  2119. .An Dug Song
  2120. removed many bugs, re-added newer features and
  2121. created OpenSSH.
  2122. .An Markus Friedl
  2123. contributed the support for SSH protocol versions 1.5 and 2.0.