diff options
author | jmc@openbsd.org <jmc@openbsd.org> | 2016-09-28 17:59:22 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-09-29 06:54:50 +1000 |
commit | 80d1c963b4dc84ffd11d09617b39c4bffda08956 (patch) | |
tree | 0f5f0f1cf7f8db66c3919378330e12e964d281b7 | |
parent | 1cfd5c06efb121e58e8b6671548fda77ef4b4455 (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.5 | 216 |
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 | |||
177 | keyword executes the specified command under the user's shell. | 177 | keyword executes the specified command under the user's shell. |
178 | If the command returns a zero exit status then the condition is considered true. | 178 | If the command returns a zero exit status then the condition is considered true. |
179 | Commands containing whitespace characters must be quoted. | 179 | Commands containing whitespace characters must be quoted. |
180 | The following character sequences in the command will be expanded prior to | 180 | Arguments to |
181 | execution: | 181 | .Cm exec |
182 | .Ql %L | 182 | accept the tokens described in the |
183 | will be substituted by the first component of the local host name, | 183 | .Sx TOKENS |
184 | .Ql %l | 184 | section. |
185 | will be substituted by the local host name (including any domain name), | ||
186 | .Ql %h | ||
187 | will be substituted by the target host name, | ||
188 | .Ql %n | ||
189 | will be substituted by the original target host name | ||
190 | specified on the command-line, | ||
191 | .Ql %p | ||
192 | the destination port, | ||
193 | .Ql %r | ||
194 | by the remote login username, and | ||
195 | .Ql %u | ||
196 | by the username of the user running | ||
197 | .Xr ssh 1 . | ||
198 | .Pp | 185 | .Pp |
199 | The other keywords' criteria must be single entries or comma-separated | 186 | The other keywords' criteria must be single entries or comma-separated |
200 | lists and may use the wildcard and negation operators described in the | 187 | lists and may use the wildcard and negation operators described in the |
@@ -375,19 +362,12 @@ via | |||
375 | or via a | 362 | or via a |
376 | .Cm PKCS11Provider . | 363 | .Cm PKCS11Provider . |
377 | .Pp | 364 | .Pp |
378 | The file name may use the tilde | 365 | Arguments to |
379 | syntax to refer to a user's home directory or one of the following | 366 | .Cm CertificateFile |
380 | escape characters: | 367 | may use the tilde syntax to refer to a user's home directory |
381 | .Ql %d | 368 | or the tokens described in the |
382 | (local user's home directory), | 369 | .Sx TOKENS |
383 | .Ql %u | 370 | section. |
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 |
392 | It is possible to have multiple certificate files specified in | 372 | It is possible to have multiple certificate files specified in |
393 | configuration files; these certificates will be tried in sequence. | 373 | configuration files; these certificates will be tried in sequence. |
@@ -591,28 +571,12 @@ in the | |||
591 | section above or the string | 571 | section above or the string |
592 | .Dq none | 572 | .Dq none |
593 | to disable connection sharing. | 573 | to disable connection sharing. |
594 | In the path, | 574 | Arguments to |
595 | .Ql %L | 575 | .Cm ControlPath |
596 | will be substituted by the first component of the local host name, | 576 | may use the tilde syntax to refer to a user's home directory |
597 | .Ql %l | 577 | or the tokens described in the |
598 | will be substituted by the local host name (including any domain name), | 578 | .Sx TOKENS |
599 | .Ql %h | 579 | section. |
600 | will be substituted by the target host name, | ||
601 | .Ql %n | ||
602 | will be substituted by the original target host name | ||
603 | specified on the command line, | ||
604 | .Ql %p | ||
605 | the destination port, | ||
606 | .Ql %r | ||
607 | by the remote login username, | ||
608 | .Ql %u | ||
609 | by the username and | ||
610 | .Ql %i | ||
611 | by the numeric user ID (uid) of the user running | ||
612 | .Xr ssh 1 , | ||
613 | and | ||
614 | .Ql \&%C | ||
615 | by a hash of the concatenation: %l%h%p%r. | ||
616 | It is recommended that any | 580 | It is recommended that any |
617 | .Cm ControlPath | 581 | .Cm ControlPath |
618 | used for opportunistic connection sharing include | 582 | used 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 |
916 | Specifies the real host name to log into. | 880 | Specifies the real host name to log into. |
917 | This can be used to specify nicknames or abbreviations for hosts. | 881 | This can be used to specify nicknames or abbreviations for hosts. |
918 | If the hostname contains the character sequence | 882 | Arguments to |
919 | .Ql %h , | 883 | .Cm HostName |
920 | then this will be replaced with the host name specified on the command line | 884 | accept the tokens described in the |
921 | (this is useful for manipulating unqualified names). | 885 | .Sx TOKENS |
922 | The character sequence | 886 | section. |
923 | .Ql %% | ||
924 | will be replaced by a single | ||
925 | .Ql % | ||
926 | character, which may be used when specifying IPv6 link-local addresses. | ||
927 | .Pp | ||
928 | The default is the name given on the command line. | ||
929 | Numeric IP addresses are also permitted (both on the command line and in | 887 | Numeric IP addresses are also permitted (both on the command line and in |
930 | .Cm HostName | 888 | .Cm HostName |
931 | specifications). | 889 | specifications). |
890 | The default is the name given on the command line. | ||
932 | .It Cm IdentitiesOnly | 891 | .It Cm IdentitiesOnly |
933 | Specifies that | 892 | Specifies 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 |
970 | environment variable. | 929 | environment variable. |
971 | .Pp | 930 | .Pp |
972 | The socket name may use the tilde | 931 | Arguments to |
973 | syntax to refer to a user's home directory or one of the following | 932 | .Cm IdentityAgent |
974 | escape characters: | 933 | may use the tilde syntax to refer to a user's home directory |
975 | .Ql %d | 934 | or the tokens described in the |
976 | (local user's home directory), | 935 | .Sx TOKENS |
977 | .Ql %u | 936 | section. |
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 |
986 | Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication | 938 | Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA authentication |
987 | identity is read. | 939 | identity is read. |
@@ -1007,19 +959,12 @@ appending | |||
1007 | to the path of a specified | 959 | to the path of a specified |
1008 | .Cm IdentityFile . | 960 | .Cm IdentityFile . |
1009 | .Pp | 961 | .Pp |
1010 | The file name may use the tilde | 962 | Arguments to |
1011 | syntax to refer to a user's home directory or one of the following | 963 | .Cm IdentityFile |
1012 | escape characters: | 964 | may use the tilde syntax to refer to a user's home directory |
1013 | .Ql %d | 965 | or the tokens described in the |
1014 | (local user's home directory), | 966 | .Sx TOKENS |
1015 | .Ql %u | 967 | section. |
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 |
1024 | It is possible to have | 969 | It is possible to have |
1025 | multiple identity files specified in configuration files; all these | 970 | multiple identity files specified in configuration files; all these |
@@ -1151,23 +1096,11 @@ Specifies a command to execute on the local machine after successfully | |||
1151 | connecting to the server. | 1096 | connecting to the server. |
1152 | The command string extends to the end of the line, and is executed with | 1097 | The command string extends to the end of the line, and is executed with |
1153 | the user's shell. | 1098 | the user's shell. |
1154 | The following escape character substitutions will be performed: | 1099 | Arguments to |
1155 | .Ql %d | 1100 | .Cm LocalCommand |
1156 | (local user's home directory), | 1101 | accept the tokens described in the |
1157 | .Ql %h | 1102 | .Sx TOKENS |
1158 | (remote host name), | 1103 | section. |
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 | ||
1170 | by a hash of the concatenation: %l%h%p%r. | ||
1171 | .Pp | 1104 | .Pp |
1172 | The command is run synchronously and does not have access to the | 1105 | The command is run synchronously and does not have access to the |
1173 | session of the | 1106 | session of the |
@@ -1325,14 +1258,11 @@ using the user's shell | |||
1325 | .Ql exec | 1258 | .Ql exec |
1326 | directive to avoid a lingering shell process. | 1259 | directive to avoid a lingering shell process. |
1327 | .Pp | 1260 | .Pp |
1328 | In the command string, any occurrence of | 1261 | Arguments to |
1329 | .Ql %h | 1262 | .Cm ProxyCommand |
1330 | will be substituted by the host name to | 1263 | accept the tokens described in the |
1331 | connect, | 1264 | .Sx TOKENS |
1332 | .Ql %p | 1265 | section. |
1333 | by the port, and | ||
1334 | .Ql %r | ||
1335 | by the remote user name. | ||
1336 | The command can be basically anything, | 1266 | The command can be basically anything, |
1337 | and should read from its standard input and write to its standard output. | 1267 | and should read from its standard input and write to its standard output. |
1338 | It should eventually connect an | 1268 | It should eventually connect an |
@@ -1846,6 +1776,58 @@ pool, | |||
1846 | the following entry (in authorized_keys) could be used: | 1776 | the 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 | ||
1780 | Arguments to some keywords can make use of tokens, | ||
1781 | which are expanded at runtime: | ||
1782 | .Pp | ||
1783 | .Bl -tag -width XXXX -offset indent -compact | ||
1784 | .It %% | ||
1785 | A literal | ||
1786 | .Sq % . | ||
1787 | .It \&%C | ||
1788 | Shorthand for %l%h%p%r. | ||
1789 | .It %d | ||
1790 | Local user's home directory. | ||
1791 | .It %h | ||
1792 | The remote hostname. | ||
1793 | .It %i | ||
1794 | The local user ID. | ||
1795 | .It %L | ||
1796 | The local hostname. | ||
1797 | .It %l | ||
1798 | The local hostname, including the domain name. | ||
1799 | .It %n | ||
1800 | The original remote hostname, as given on the command line. | ||
1801 | .It %p | ||
1802 | The remote port. | ||
1803 | .It %r | ||
1804 | The remote username. | ||
1805 | .It %u | ||
1806 | The local username. | ||
1807 | .El | ||
1808 | .Pp | ||
1809 | .Cm Match exec | ||
1810 | accepts the tokens %%, %h, %L, %l, %n, %p, %r, and %u. | ||
1811 | .Pp | ||
1812 | .Cm CertificateFile | ||
1813 | accepts the tokens %%, %d, %h, %l, %r, and %u. | ||
1814 | .Pp | ||
1815 | .Cm ControlPath | ||
1816 | accepts the tokens %%, %C, %h, %i, %L, %l, %n, %p, %r, and %u. | ||
1817 | .Pp | ||
1818 | .Cm HostName | ||
1819 | accepts the tokens %% and %h. | ||
1820 | .Pp | ||
1821 | .Cm IdentityAgent | ||
1822 | and | ||
1823 | .Cm IdentityFile | ||
1824 | accept the tokens %%, %d, %h, %l, %r, and %u. | ||
1825 | .Pp | ||
1826 | .Cm LocalCommand | ||
1827 | accepts the tokens %%, %C, %d, %h, %l, %n, %p, %r, and %u. | ||
1828 | .Pp | ||
1829 | .Cm ProxyCommand | ||
1830 | accepts 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 |