summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc@openbsd.org <jmc@openbsd.org>2016-09-28 17:59:22 +0000
committerDamien Miller <djm@mindrot.org>2016-09-29 06:54:50 +1000
commit80d1c963b4dc84ffd11d09617b39c4bffda08956 (patch)
tree0f5f0f1cf7f8db66c3919378330e12e964d281b7
parent1cfd5c06efb121e58e8b6671548fda77ef4b4455 (diff)
upstream commit
use a separate TOKENS section, as we've done for sshd_config(5); help/ok djm Upstream-ID: 640e32b5e4838e4363738cdec955084b3579481d
-rw-r--r--ssh_config.5216
1 files changed, 99 insertions, 117 deletions
diff --git a/ssh_config.5 b/ssh_config.5
index 50eb03b24..1d5150080 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -33,8 +33,8 @@
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 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. 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: ssh_config.5,v 1.238 2016/09/22 17:55:13 djm Exp $ 36.\" $OpenBSD: ssh_config.5,v 1.239 2016/09/28 17:59:22 jmc Exp $
37.Dd $Mdocdate: September 22 2016 $ 37.Dd $Mdocdate: September 28 2016 $
38.Dt SSH_CONFIG 5 38.Dt SSH_CONFIG 5
39.Os 39.Os
40.Sh NAME 40.Sh NAME
@@ -177,24 +177,11 @@ The
177keyword executes the specified command under the user's shell. 177keyword executes the specified command under the user's shell.
178If the command returns a zero exit status then the condition is considered true. 178If the command returns a zero exit status then the condition is considered true.
179Commands containing whitespace characters must be quoted. 179Commands containing whitespace characters must be quoted.
180The following character sequences in the command will be expanded prior to 180Arguments to
181execution: 181.Cm exec
182.Ql %L 182accept the tokens described in the
183will be substituted by the first component of the local host name, 183.Sx TOKENS
184.Ql %l 184section.
185will be substituted by the local host name (including any domain name),
186.Ql %h
187will be substituted by the target host name,
188.Ql %n
189will be substituted by the original target host name
190specified on the command-line,
191.Ql %p
192the destination port,
193.Ql %r
194by the remote login username, and
195.Ql %u
196by the username of the user running
197.Xr ssh 1 .
198.Pp 185.Pp
199The other keywords' criteria must be single entries or comma-separated 186The other keywords' criteria must be single entries or comma-separated
200lists and may use the wildcard and negation operators described in the 187lists and may use the wildcard and negation operators described in the
@@ -375,19 +362,12 @@ via
375or via a 362or via a
376.Cm PKCS11Provider . 363.Cm PKCS11Provider .
377.Pp 364.Pp
378The file name may use the tilde 365Arguments to
379syntax to refer to a user's home directory or one of the following 366.Cm CertificateFile
380escape characters: 367may use the tilde syntax to refer to a user's home directory
381.Ql %d 368or the tokens described in the
382(local user's home directory), 369.Sx TOKENS
383.Ql %u 370section.
384(local user name),
385.Ql %l
386(local host name),
387.Ql %h
388(remote host name) or
389.Ql %r
390(remote user name).
391.Pp 371.Pp
392It is possible to have multiple certificate files specified in 372It is possible to have multiple certificate files specified in
393configuration files; these certificates will be tried in sequence. 373configuration files; these certificates will be tried in sequence.
@@ -591,28 +571,12 @@ in the
591section above or the string 571section above or the string
592.Dq none 572.Dq none
593to disable connection sharing. 573to disable connection sharing.
594In the path, 574Arguments to
595.Ql %L 575.Cm ControlPath
596will be substituted by the first component of the local host name, 576may use the tilde syntax to refer to a user's home directory
597.Ql %l 577or the tokens described in the
598will be substituted by the local host name (including any domain name), 578.Sx TOKENS
599.Ql %h 579section.
600will be substituted by the target host name,
601.Ql %n
602will be substituted by the original target host name
603specified on the command line,
604.Ql %p
605the destination port,
606.Ql %r
607by the remote login username,
608.Ql %u
609by the username and
610.Ql %i
611by the numeric user ID (uid) of the user running
612.Xr ssh 1 ,
613and
614.Ql \&%C
615by a hash of the concatenation: %l%h%p%r.
616It is recommended that any 580It is recommended that any
617.Cm ControlPath 581.Cm ControlPath
618used for opportunistic connection sharing include 582used for opportunistic connection sharing include
@@ -915,20 +879,15 @@ or for multiple servers running on a single host.
915.It Cm HostName 879.It Cm HostName
916Specifies the real host name to log into. 880Specifies the real host name to log into.
917This can be used to specify nicknames or abbreviations for hosts. 881This can be used to specify nicknames or abbreviations for hosts.
918If the hostname contains the character sequence 882Arguments to
919.Ql %h , 883.Cm HostName
920then this will be replaced with the host name specified on the command line 884accept the tokens described in the
921(this is useful for manipulating unqualified names). 885.Sx TOKENS
922The character sequence 886section.
923.Ql %%
924will be replaced by a single
925.Ql %
926character, which may be used when specifying IPv6 link-local addresses.
927.Pp
928The default is the name given on the command line.
929Numeric IP addresses are also permitted (both on the command line and in 887Numeric IP addresses are also permitted (both on the command line and in
930.Cm HostName 888.Cm HostName
931specifications). 889specifications).
890The default is the name given on the command line.
932.It Cm IdentitiesOnly 891.It Cm IdentitiesOnly
933Specifies that 892Specifies that
934.Xr ssh 1 893.Xr ssh 1
@@ -969,19 +928,12 @@ is specified, the location of the socket will be read from the
969.Ev SSH_AUTH_SOCK 928.Ev SSH_AUTH_SOCK
970environment variable. 929environment variable.
971.Pp 930.Pp
972The socket name may use the tilde 931Arguments to
973syntax to refer to a user's home directory or one of the following 932.Cm IdentityAgent
974escape characters: 933may use the tilde syntax to refer to a user's home directory
975.Ql %d 934or the tokens described in the
976(local user's home directory), 935.Sx TOKENS
977.Ql %u 936section.
978(local user name),
979.Ql %l
980(local host name),
981.Ql %h
982(remote host name) or
983.Ql %r
984(remote user name).
985.It Cm IdentityFile 937.It Cm IdentityFile
986Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication 938Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication
987identity is read. 939identity is read.
@@ -1007,19 +959,12 @@ appending
1007to the path of a specified 959to the path of a specified
1008.Cm IdentityFile . 960.Cm IdentityFile .
1009.Pp 961.Pp
1010The file name may use the tilde 962Arguments to
1011syntax to refer to a user's home directory or one of the following 963.Cm IdentityFile
1012escape characters: 964may use the tilde syntax to refer to a user's home directory
1013.Ql %d 965or the tokens described in the
1014(local user's home directory), 966.Sx TOKENS
1015.Ql %u 967section.
1016(local user name),
1017.Ql %l
1018(local host name),
1019.Ql %h
1020(remote host name) or
1021.Ql %r
1022(remote user name).
1023.Pp 968.Pp
1024It is possible to have 969It is possible to have
1025multiple identity files specified in configuration files; all these 970multiple identity files specified in configuration files; all these
@@ -1151,23 +1096,11 @@ Specifies a command to execute on the local machine after successfully
1151connecting to the server. 1096connecting to the server.
1152The command string extends to the end of the line, and is executed with 1097The command string extends to the end of the line, and is executed with
1153the user's shell. 1098the user's shell.
1154The following escape character substitutions will be performed: 1099Arguments to
1155.Ql %d 1100.Cm LocalCommand
1156(local user's home directory), 1101accept the tokens described in the
1157.Ql %h 1102.Sx TOKENS
1158(remote host name), 1103section.
1159.Ql %l
1160(local host name),
1161.Ql %n
1162(host name as provided on the command line),
1163.Ql %p
1164(remote port),
1165.Ql %r
1166(remote user name) or
1167.Ql %u
1168(local user name) or
1169.Ql \&%C
1170by a hash of the concatenation: %l%h%p%r.
1171.Pp 1104.Pp
1172The command is run synchronously and does not have access to the 1105The command is run synchronously and does not have access to the
1173session of the 1106session of the
@@ -1325,14 +1258,11 @@ using the user's shell
1325.Ql exec 1258.Ql exec
1326directive to avoid a lingering shell process. 1259directive to avoid a lingering shell process.
1327.Pp 1260.Pp
1328In the command string, any occurrence of 1261Arguments to
1329.Ql %h 1262.Cm ProxyCommand
1330will be substituted by the host name to 1263accept the tokens described in the
1331connect, 1264.Sx TOKENS
1332.Ql %p 1265section.
1333by the port, and
1334.Ql %r
1335by the remote user name.
1336The command can be basically anything, 1266The command can be basically anything,
1337and should read from its standard input and write to its standard output. 1267and should read from its standard input and write to its standard output.
1338It should eventually connect an 1268It should eventually connect an
@@ -1846,6 +1776,58 @@ pool,
1846the following entry (in authorized_keys) could be used: 1776the following entry (in authorized_keys) could be used:
1847.Pp 1777.Pp
1848.Dl from=\&"!*.dialup.example.com,*.example.com\&" 1778.Dl from=\&"!*.dialup.example.com,*.example.com\&"
1779.Sh TOKENS
1780Arguments to some keywords can make use of tokens,
1781which are expanded at runtime:
1782.Pp
1783.Bl -tag -width XXXX -offset indent -compact
1784.It %%
1785A literal
1786.Sq % .
1787.It \&%C
1788Shorthand for %l%h%p%r.
1789.It %d
1790Local user's home directory.
1791.It %h
1792The remote hostname.
1793.It %i
1794The local user ID.
1795.It %L
1796The local hostname.
1797.It %l
1798The local hostname, including the domain name.
1799.It %n
1800The original remote hostname, as given on the command line.
1801.It %p
1802The remote port.
1803.It %r
1804The remote username.
1805.It %u
1806The local username.
1807.El
1808.Pp
1809.Cm Match exec
1810accepts the tokens %%, %h, %L, %l, %n, %p, %r, and %u.
1811.Pp
1812.Cm CertificateFile
1813accepts the tokens %%, %d, %h, %l, %r, and %u.
1814.Pp
1815.Cm ControlPath
1816accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u.
1817.Pp
1818.Cm HostName
1819accepts the tokens %% and %h.
1820.Pp
1821.Cm IdentityAgent
1822and
1823.Cm IdentityFile
1824accept the tokens %%, %d, %h, %l, %r, and %u.
1825.Pp
1826.Cm LocalCommand
1827accepts the tokens %%, %C, %d, %h, %l, %n, %p, %r, and %u.
1828.Pp
1829.Cm ProxyCommand
1830accepts the tokens %%, %h, %p, and %r.
1849.Sh FILES 1831.Sh FILES
1850.Bl -tag -width Ds 1832.Bl -tag -width Ds
1851.It Pa ~/.ssh/config 1833.It Pa ~/.ssh/config