aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorPaul Eggert2016-01-30 11:41:07 -0800
committerPaul Eggert2016-01-30 11:41:07 -0800
commit9304e6d3a222de6ef1c405bfd6e09eee6ed2c2aa (patch)
tree730b07f317a18596dba60ac473d40069b6d1c1cf /doc/misc
parentbeec9cbb1705a7bc4e11a11fe4b5a2f1bfca96a0 (diff)
parent12eeaa877c4396880c926c26b4010a059b6a3325 (diff)
downloademacs-9304e6d3a222de6ef1c405bfd6e09eee6ed2c2aa.tar.gz
emacs-9304e6d3a222de6ef1c405bfd6e09eee6ed2c2aa.zip
-
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/tramp.texi209
1 files changed, 88 insertions, 121 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 14afb4ad353..37bf7ea8bc4 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -18,52 +18,21 @@
18@include trampver.texi 18@include trampver.texi
19 19
20@c Macro for formatting a file name according to the respective syntax. 20@c Macro for formatting a file name according to the respective syntax.
21@c xxx and yyy are auxiliary macros in order to omit leading and 21@c Macro arguments should not have any leading or
22@c trailing whitespace. Not very elegant, but I don't know it better. 22@c trailing whitespace. Not very elegant, but I don't know it better.
23 23
24@c There are subtle differences between texinfo 4.13 and 5.0. We must 24@macro trampfn {method, userhost, localname}
25@c declare two versions of the macro. This will be improved, hopefully.
26
27@c Texinfo 5.0.
28@ifset txicommandconditionals
29@macro xxx {one}
30@set \one\
31@end macro
32
33@macro yyy {one, two}
34@xxx{x\one\}@c
35@ifclear x
36\one\@w{}\two\@c
37@end ifclear
38@clear x\one\
39@end macro
40
41@macro trampfn {method, user, host, localname}
42@value{prefix}@c 25@value{prefix}@c
43@yyy{\method\,@value{postfixhop}}@c 26\method\@value{postfixhop}@c
44@yyy{\user\,@@}@c 27\userhost\@value{postfix}\localname\
45\host\@value{postfix}\localname\
46@end macro 28@end macro
47@end ifset
48 29
49@c Texinfo 4.13. 30@c Similar, but without a method prefix.
50@ifclear txicommandconditionals
51@macro xxx {one}@c
52@set \one\@c
53@end macro
54 31
55@macro yyy {one, two}@c 32@macro trampf {userhost, localname}
56@xxx{x\one\}@c 33@value{prefix}@c
57@ifclear x@c 34\userhost\@value{postfix}\localname\
58\one\@w{}\two\@c
59@end ifclear
60@clear x\one\@c
61@end macro
62
63@macro trampfn {method, user, host, localname}@c
64@value{prefix}@yyy{\method\,@value{postfixhop}}@yyy{\user\,@@}\host\@value{postfix}\localname\@c
65@end macro 35@end macro
66@end ifclear
67 36
68@copying 37@copying
69Copyright @copyright{} 1999--2016 Free Software Foundation, Inc. 38Copyright @copyright{} 1999--2016 Free Software Foundation, Inc.
@@ -469,7 +438,7 @@ In November 2012, added Juergen Hoetzel's @file{tramp-adb.el}.
469 438
470@value{tramp} is initially configured to use the @command{scp} program 439@value{tramp} is initially configured to use the @command{scp} program
471to connect to the remote host. Just type @kbd{C-x C-f} and then enter 440to connect to the remote host. Just type @kbd{C-x C-f} and then enter
472file name @file{@trampfn{, user, host, /path/to.file}}. For details, 441file name @file{@trampf{user@@host,/path/to.file}}. For details,
473see @xref{Default Method}. 442see @xref{Default Method}.
474 443
475For problems related to the behavior of remote shell, see @ref{Remote 444For problems related to the behavior of remote shell, see @ref{Remote
@@ -877,7 +846,7 @@ authorization, @value{tramp} provides for an extended syntax in
877percent symbol, and domain is the windows domain name). An example: 846percent symbol, and domain is the windows domain name). An example:
878 847
879@example 848@example
880@trampfn{smb, daniel%BIZARRE, melancholia, /daniel$$/.emacs} 849@trampfn{smb,daniel%BIZARRE@@melancholia,/daniel$$/.emacs}
881@end example 850@end example
882 851
883where user @code{daniel} connects as a domain user to the SMB host 852where user @code{daniel} connects as a domain user to the SMB host
@@ -889,7 +858,7 @@ substitute the domain name with the name of the local host in
889UPPERCASE as shown here: 858UPPERCASE as shown here:
890 859
891@example 860@example
892@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs} 861@trampfn{smb,daniel%MELANCHOLIA@@melancholia,/daniel$$/.emacs}
893@end example 862@end example
894 863
895where user @code{daniel} connects as local user to the SMB host 864where user @code{daniel} connects as local user to the SMB host
@@ -932,7 +901,7 @@ Emacs.
932 901
933@value{tramp} does not require a host name part of the remote file 902@value{tramp} does not require a host name part of the remote file
934name when a single Android device is connected to @command{adb}. 903name when a single Android device is connected to @command{adb}.
935@value{tramp} instead uses @file{@trampfn{adb, , ,}} as the default 904@value{tramp} instead uses @file{@trampfn{adb,,}} as the default
936name. @command{adb devices} shows available host names. 905name. @command{adb devices} shows available host names.
937 906
938@option{adb} method normally does not need user name to authenticate 907@option{adb} method normally does not need user name to authenticate
@@ -974,7 +943,7 @@ D-Bus, dbus}.
974This method is for connecting to remote hosts with the Apple Filing 943This method is for connecting to remote hosts with the Apple Filing
975Protocol for accessing files on Mac OS X volumes. @value{tramp} access 944Protocol for accessing files on Mac OS X volumes. @value{tramp} access
976syntax requires a leading volume (share) name, for example: 945syntax requires a leading volume (share) name, for example:
977@file{@trampfn{afp, user, host, /volume}}. 946@file{@trampfn{afp,user@@host,/volume}}.
978 947
979@item @option{dav} 948@item @option{dav}
980@item @option{davs} 949@item @option{davs}
@@ -1138,7 +1107,7 @@ access and it has the most reasonable security protocols, use
1138@file{/etc/motd} file on the otherhost: 1107@file{/etc/motd} file on the otherhost:
1139 1108
1140@example 1109@example
1141@kbd{C-x C-f @trampfn{ssh, root, otherhost,/etc/motd} @key{RET}} 1110@kbd{C-x C-f @trampfn{ssh,root@@otherhost,/etc/motd} @key{RET}}
1142@end example 1111@end example
1143 1112
1144If @option{ssh} is unavailable for whatever reason, look for other 1113If @option{ssh} is unavailable for whatever reason, look for other
@@ -1149,7 +1118,7 @@ For editing local files as @option{su} or @option{sudo} methods, try
1149the shortened syntax of @samp{root}: 1118the shortened syntax of @samp{root}:
1150 1119
1151@example 1120@example
1152@kbd{C-x C-f @trampfn{su, , , /etc/motd} @key{RET}} 1121@kbd{C-x C-f @trampfn{su,,/etc/motd} @key{RET}}
1153@end example 1122@end example
1154 1123
1155For editing large files, @option{scp} is faster than @option{ssh}. 1124For editing large files, @option{scp} is faster than @option{ssh}.
@@ -1222,7 +1191,7 @@ and default host can be overridden as follows:
1222 tramp-default-host "target") 1191 tramp-default-host "target")
1223@end lisp 1192@end lisp
1224 1193
1225With both defaults set, @samp{@trampfn{ssh, , ,}} will connect 1194With both defaults set, @samp{@trampfn{ssh,,}} will connect
1226@value{tramp} to John's home directory on target. 1195@value{tramp} to John's home directory on target.
1227 1196
1228@strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix 1197@strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix
@@ -1275,7 +1244,7 @@ user @samp{bird} to reach remote hosts outside the local domain:
1275 1244
1276@lisp 1245@lisp
1277(add-to-list 'tramp-default-proxies-alist 1246(add-to-list 'tramp-default-proxies-alist
1278 '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}")) 1247 '("\\." nil "@trampfn{ssh,bird@@bastion.your.domain,}"))
1279(add-to-list 'tramp-default-proxies-alist 1248(add-to-list 'tramp-default-proxies-alist
1280 '("\\.your\\.domain\\'" nil nil)) 1249 '("\\.your\\.domain\\'" nil nil))
1281@end lisp 1250@end lisp
@@ -1291,7 +1260,7 @@ connect to @samp{bastion.your.domain}, then:
1291(add-to-list 'tramp-default-proxies-alist 1260(add-to-list 'tramp-default-proxies-alist
1292 '("\\`bastion\\.your\\.domain\\'" 1261 '("\\`bastion\\.your\\.domain\\'"
1293 "\\`bird\\'" 1262 "\\`bird\\'"
1294 "@trampfn{ssh, , jump.your.domain,}")) 1263 "@trampfn{ssh,jump.your.domain,}"))
1295@end lisp 1264@end lisp
1296 1265
1297@var{proxy} can take patterns @code{%h} or @code{%u} for @var{host} or 1266@var{proxy} can take patterns @code{%h} or @code{%u} for @var{host} or
@@ -1303,10 +1272,10 @@ access, then use this alist entry:
1303 1272
1304@lisp 1273@lisp
1305(add-to-list 'tramp-default-proxies-alist 1274(add-to-list 'tramp-default-proxies-alist
1306 '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}")) 1275 '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh,%h,}"))
1307@end lisp 1276@end lisp
1308 1277
1309Opening @file{@trampfn{sudo, , randomhost.your.domain,}} first 1278Opening @file{@trampfn{sudo,randomhost.your.domain,}} first
1310connects to @samp{randomhost.your.domain} via @code{ssh} under your 1279connects to @samp{randomhost.your.domain} via @code{ssh} under your
1311account name, and then perform @code{sudo -u root} on that host. 1280account name, and then perform @code{sudo -u root} on that host.
1312 1281
@@ -1322,7 +1291,7 @@ local one, first connect via @command{ssh}, and then apply
1322 1291
1323@lisp 1292@lisp
1324(add-to-list 'tramp-default-proxies-alist 1293(add-to-list 'tramp-default-proxies-alist
1325 '(nil "\\`root\\'" "@trampfn{ssh, , %h,}")) 1294 '(nil "\\`root\\'" "@trampfn{ssh,%h,}"))
1326(add-to-list 'tramp-default-proxies-alist 1295(add-to-list 'tramp-default-proxies-alist
1327 '((regexp-quote (system-name)) nil nil)) 1296 '((regexp-quote (system-name)) nil nil))
1328@end lisp 1297@end lisp
@@ -1346,7 +1315,7 @@ discussion of ethical issues.} Then the configuration is:
1346@lisp 1315@lisp
1347(add-to-list 'tramp-default-proxies-alist 1316(add-to-list 'tramp-default-proxies-alist
1348 '("\\`host\\.other\\.domain\\'" nil 1317 '("\\`host\\.other\\.domain\\'" nil
1349 "@trampfn{tunnel, , proxy.your.domain#3128,}")) 1318 "@trampfn{tunnel,proxy.your.domain#3128,}"))
1350@end lisp 1319@end lisp
1351 1320
1352Gateway methods in a multiple hop chain can be declared only as the first hop. 1321Gateway methods in a multiple hop chain can be declared only as the first hop.
@@ -1596,8 +1565,7 @@ cases, two different connections may result in the same persistent
1596information. For example, connecting to a host using @command{ssh} and 1565information. For example, connecting to a host using @command{ssh} and
1597connecting to the same host through @code{sshd} on port 3001. Both 1566connecting to the same host through @code{sshd} on port 3001. Both
1598access methods result in nearly identical persistent specifications 1567access methods result in nearly identical persistent specifications
1599@file{@trampfn{ssh, , localhost,}} and @file{@trampfn{ssh, , 1568@file{@trampfn{ssh,localhost,}} and @file{@trampfn{ssh,localhost#3001,}}.
1600localhost#3001,}}.
1601 1569
1602Changing host names could avoid duplicates. One way is to add a 1570Changing host names could avoid duplicates. One way is to add a
1603@option{Host} section in @file{~/.ssh/config} (@pxref{Frequently Asked 1571@option{Host} section in @file{~/.ssh/config} (@pxref{Frequently Asked
@@ -1629,10 +1597,10 @@ remote shell:
1629 1597
1630@lisp 1598@lisp
1631(add-to-list 'tramp-connection-properties 1599(add-to-list 'tramp-connection-properties
1632 (list (regexp-quote "@trampfn{ssh, user, randomhost.your.domain,}") 1600 (list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
1633 "remote-shell" "/bin/ksh")) 1601 "remote-shell" "/bin/ksh"))
1634(add-to-list 'tramp-connection-properties 1602(add-to-list 'tramp-connection-properties
1635 (list (regexp-quote "@trampfn{ssh, user, randomhost.your.domain,}") 1603 (list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
1636 "remote-shell-login" '("-"))) 1604 "remote-shell-login" '("-")))
1637@end lisp 1605@end lisp
1638 1606
@@ -1648,7 +1616,7 @@ special property @samp{busybox}. For example:
1648 1616
1649@lisp 1617@lisp
1650(add-to-list 'tramp-connection-properties 1618(add-to-list 'tramp-connection-properties
1651 (list (regexp-quote "@trampfn{ssh, user, randomhost.your.domain,}") 1619 (list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
1652 "busybox" t)) 1620 "busybox" t))
1653@end lisp 1621@end lisp
1654 1622
@@ -1949,8 +1917,8 @@ directory for temporary files:
1949@end lisp 1917@end lisp
1950 1918
1951@noindent 1919@noindent
1952Open a remote connection with the command @kbd{C-x C-f @trampfn{ssh, , 1920Open a remote connection with the command @kbd{C-x C-f
1953192.168.0.26#2222, }}, where @command{sshd} is listening on port 1921@trampfn{ssh,192.168.0.26#2222,}}, where @command{sshd} is listening on port
1954@samp{2222}. 1922@samp{2222}.
1955 1923
1956To add a corresponding entry to the @file{~/.ssh/config} file 1924To add a corresponding entry to the @file{~/.ssh/config} file
@@ -1974,7 +1942,7 @@ the previous example, fix the connection properties as follows:
1974 1942
1975@noindent 1943@noindent
1976Open a remote connection with a more concise command @kbd{C-x C-f 1944Open a remote connection with a more concise command @kbd{C-x C-f
1977@trampfn{ssh, , android, }}. 1945@trampfn{ssh,android,}}.
1978 1946
1979 1947
1980@node Auto-save and Backup 1948@node Auto-save and Backup
@@ -1992,7 +1960,7 @@ by default writes backup files to the same directory as the original
1992files unless changed to another location, such as 1960files unless changed to another location, such as
1993@file{~/.emacs.d/backups/}. Such a directory will also be used by 1961@file{~/.emacs.d/backups/}. Such a directory will also be used by
1994default by @value{tramp} when using, say, a restricted file 1962default by @value{tramp} when using, say, a restricted file
1995@file{@trampfn{su, root, localhost, /etc/secretfile}}. The backup 1963@file{@trampfn{su,root@@localhost,/etc/secretfile}}. The backup
1996file of the secretfile is now owned by the user logged in from tramp 1964file of the secretfile is now owned by the user logged in from tramp
1997and not root. 1965and not root.
1998 1966
@@ -2042,9 +2010,9 @@ Example:
2042@end lisp 2010@end lisp
2043 2011
2044@noindent 2012@noindent
2045The backup file name of @file{@trampfn{su, root, localhost, 2013The backup file name of
2046/etc/secretfile}} would be @file{@trampfn{su, root, localhost, 2014@file{@trampfn{su,root@@localhost,/etc/secretfile}} would be
2047~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}} 2015@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}.
2048 2016
2049Just as for backup files, similar issues of file naming affect 2017Just as for backup files, similar issues of file naming affect
2050auto-saving @value{tramp} files. Auto-saved files are saved in the 2018auto-saving @value{tramp} files. Auto-saved files are saved in the
@@ -2143,7 +2111,7 @@ is a feature of Emacs that may cause missed prompts when using
2143@cindex file name syntax 2111@cindex file name syntax
2144@cindex file name examples 2112@cindex file name examples
2145 2113
2146@file{@trampfn{, , host, localfilename}} 2114@file{@trampf{host,localfilename}}
2147opens file @var{localfilename} on the remote host @var{host}, using 2115opens file @var{localfilename} on the remote host @var{host}, using
2148the default method. @xref{Default Method}. 2116the default method. @xref{Default Method}.
2149 2117
@@ -2169,21 +2137,21 @@ For the file @file{/etc/squid.conf} on the host @code{melancholia}.
2169 2137
2170@end table 2138@end table
2171 2139
2172@var{host} can take IPv4 or IPv6 address, as in @file{@trampfn{, , 2140@var{host} can take IPv4 or IPv6 address, as in
2173127.0.0.1, .emacs}} or @file{@trampfn{, , 2141@file{@trampf{127.0.0.1,.emacs}} or
2174@value{ipv6prefix}::1@value{ipv6postfix}, .emacs}}. For syntactical 2142@file{@trampf{@value{ipv6prefix}::1@value{ipv6postfix},.emacs}}.
2175reasons, IPv6 addresses must be embedded in square brackets 2143For syntactical reasons, IPv6 addresses must be embedded in square
2176@file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}. 2144brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}.
2177 2145
2178By default, @value{tramp} will use the current local user name as the 2146By default, @value{tramp} will use the current local user name as the
2179remote user name for log in to the remote host. Specifying a different 2147remote user name for log in to the remote host. Specifying a different
2180name using the proper syntax will override this default behavior: 2148name using the proper syntax will override this default behavior:
2181 2149
2182@example 2150@example
2183@trampfn{, user, host, path/to.file} 2151@trampf{user@@host,path/to.file}
2184@end example 2152@end example
2185 2153
2186@file{@trampfn{, daniel, melancholia, .emacs}} is for file 2154@file{@trampf{daniel@@melancholia,.emacs}} is for file
2187@file{.emacs} in @code{daniel}'s home directory on the host, 2155@file{.emacs} in @code{daniel}'s home directory on the host,
2188@code{melancholia}. 2156@code{melancholia}.
2189 2157
@@ -2197,15 +2165,14 @@ change.
2197 2165
2198To connect to the host @code{melancholia} as @code{daniel}, using 2166To connect to the host @code{melancholia} as @code{daniel}, using
2199@option{ssh} method for @file{.emacs} in @code{daniel}'s home 2167@option{ssh} method for @file{.emacs} in @code{daniel}'s home
2200directory, the full specification is: @file{@trampfn{ssh, daniel, 2168directory, the full specification is:
2201melancholia, .emacs}}. 2169@file{@trampfn{ssh,daniel@@melancholia,.emacs}}.
2202 2170
2203A remote file name containing a host name, which is the same string as 2171A remote file name containing a host name, which is the same string as
2204a method name, is not allowed. 2172a method name, is not allowed.
2205 2173
2206For specifying port numbers, affix @file{#<port>} to the host 2174For specifying port numbers, affix @file{#<port>} to the host
2207name. For example: @file{@trampfn{ssh, daniel, melancholia#42, 2175name. For example: @file{@trampfn{ssh,daniel@@melancholia#42,.emacs}}.
2208.emacs}}.
2209 2176
2210 2177
2211@node File name completion 2178@node File name completion
@@ -2224,7 +2191,7 @@ For example, type @kbd{C-x C-f @value{prefix}t @key{TAB}},
2224@value{tramp} completion choices show up as 2191@value{tramp} completion choices show up as
2225 2192
2226@example 2193@example
2227@c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}} 2194@c @multitable {@trampfn{telnet,melancholia.danann.net,}} {@trampfn{telnet,192.168.0.1,}}
2228@multitable @columnfractions .5 .5 2195@multitable @columnfractions .5 .5
2229@item @value{prefixhop}telnet@value{postfixhop} @tab tmp/ 2196@item @value{prefixhop}telnet@value{postfixhop} @tab tmp/
2230@item @value{prefixhop}toto@value{postfix} @tab 2197@item @value{prefixhop}toto@value{postfix} @tab
@@ -2244,10 +2211,11 @@ shows host names @value{tramp} from @file{/etc/hosts} file, for example.
2244 2211
2245@example 2212@example
2246@multitable @columnfractions .5 .5 2213@multitable @columnfractions .5 .5
2247@c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}} 2214@c @multitable {@trampfn{telnet,melancholia.danann.net,}} {@trampfn{telnet,192.168.0.1,}}
2248@item @trampfn{telnet, , 127.0.0.1,} @tab @trampfn{telnet, , 192.168.0.1,} 2215@item @trampfn{telnet,127.0.0.1,} @tab @trampfn{telnet,192.168.0.1,}
2249@item @trampfn{telnet, , @value{ipv6prefix}::1@value{ipv6postfix},} @tab @trampfn{telnet, , localhost,} 2216@c @item @trampfn{telnet,@value{ipv6prefix}::1@value{ipv6postfix},} @tab @trampfn{telnet,localhost,}
2250@item @trampfn{telnet, , melancholia.danann.net,} @tab @trampfn{telnet, , melancholia,} 2217@item @value{prefix}telnet@value{postfixhop}@value{ipv6prefix}::1@value{ipv6postfix}@value{postfix} @tab @trampfn{telnet,localhost,}
2218@item @trampfn{telnet,melancholia.danann.net,} @tab @trampfn{telnet,melancholia,}
2251@end multitable 2219@end multitable
2252@end example 2220@end example
2253 2221
@@ -2274,13 +2242,13 @@ stands for the default behavior.
2274Example: 2242Example:
2275 2243
2276@example 2244@example
2277@kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin//etc} @key{TAB}} 2245@kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin//etc} @key{TAB}}
2278 @print{} @trampfn{telnet, , melancholia, /etc} 2246 @print{} @trampfn{telnet,melancholia,/etc}
2279 2247
2280@kbd{C-x C-f @trampfn{telnet, , melancholia, //etc} @key{TAB}} 2248@kbd{C-x C-f @trampfn{telnet,melancholia,//etc} @key{TAB}}
2281 @print{} /etc 2249 @print{} /etc
2282 2250
2283@kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin///etc} @key{TAB}} 2251@kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin///etc} @key{TAB}}
2284 @print{} /etc 2252 @print{} /etc
2285@end example 2253@end example
2286 2254
@@ -2314,8 +2282,7 @@ remote host name and file name. For example, hopping over a single
2314proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}: 2282proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}:
2315 2283
2316@example 2284@example
2317@c @kbd{C-x C-f @trampfn{ssh@value{postfixhop}bird@@bastion|ssh, you, 2285@c @kbd{C-x C-f @trampfn{ssh@value{postfixhop}bird@@bastion|ssh,you,remotehost,/path}}
2318@c remotehost, /path}}
2319@kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path} 2286@kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path}
2320@end example 2287@end example
2321 2288
@@ -2324,8 +2291,8 @@ Proxies can take patterns @code{%h} or @code{%u}.
2324@value{tramp} adds the ad-hoc definitions on the fly to 2291@value{tramp} adds the ad-hoc definitions on the fly to
2325@code{tramp-default-proxies-alist} and is available for re-use during 2292@code{tramp-default-proxies-alist} and is available for re-use during
2326that Emacs session. Subsequent @value{tramp} connections to the same 2293that Emacs session. Subsequent @value{tramp} connections to the same
2327remote host can then use the shortcut form: @samp{@trampfn{ssh, you, 2294remote host can then use the shortcut form:
2328remotehost, /path}}. 2295@samp{@trampfn{ssh,you@@remotehost,/path}}.
2329 2296
2330@defopt tramp-save-ad-hoc-proxies 2297@defopt tramp-save-ad-hoc-proxies
2331@vindex tramp-save-ad-hoc-proxies 2298@vindex tramp-save-ad-hoc-proxies
@@ -2478,7 +2445,7 @@ on remote hosts and displays output in buffers on the local
2478host. Example: 2445host. Example:
2479 2446
2480@example 2447@example
2481@kbd{C-x C-f @trampfn{sudo, , , } @key{RET}} 2448@kbd{C-x C-f @trampfn{sudo,,} @key{RET}}
2482@kbd{M-! tail -f /var/log/syslog.log & @key{RET}} 2449@kbd{M-! tail -f /var/log/syslog.log & @key{RET}}
2483@end example 2450@end example
2484 2451
@@ -2498,14 +2465,14 @@ You must add the module @code{eshell-tramp} to
2498@kbd{M-x eshell} on a remote host: 2465@kbd{M-x eshell} on a remote host:
2499 2466
2500@example 2467@example
2501@b{~ $} cd @trampfn{sudo, , , /etc} @key{RET} 2468@b{~ $} cd @trampfn{sudo,,/etc} @key{RET}
2502@b{@trampfn{sudo, root, host, /etc} $} hostname @key{RET} 2469@b{@trampfn{sudo,root@@host,/etc} $} hostname @key{RET}
2503host 2470host
2504@b{@trampfn{sudo, root, host, /etc} $} id @key{RET} 2471@b{@trampfn{sudo,root@@host,/etc} $} id @key{RET}
2505uid=0(root) gid=0(root) groups=0(root) 2472uid=0(root) gid=0(root) groups=0(root)
2506@b{@trampfn{sudo, root, host, /etc} $} find-file shadow @key{RET} 2473@b{@trampfn{sudo,root@@host,/etc} $} find-file shadow @key{RET}
2507#<buffer shadow> 2474#<buffer shadow>
2508@b{@trampfn{sudo, root, host, /etc} $} 2475@b{@trampfn{sudo,root@@host,/etc} $}
2509@end example 2476@end example
2510 2477
2511@code{eshell} in Emacs 23.2 added custom @code{su} and @code{sudo} 2478@code{eshell} in Emacs 23.2 added custom @code{su} and @code{sudo}
@@ -2515,16 +2482,16 @@ commands that set the default directory correctly for the
2515(@pxref{Multi-hops}): 2482(@pxref{Multi-hops}):
2516 2483
2517@example 2484@example
2518@b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET} 2485@b{~ $} cd @trampfn{ssh,user@@remotehost,/etc} @key{RET}
2519@b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow @key{RET} 2486@b{@trampfn{ssh,user@@remotehost,/etc} $} find-file shadow @key{RET}
2520File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow} 2487File is not readable: @trampfn{ssh,user@@remotehost,/etc/shadow}
2521@b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow @key{RET} 2488@b{@trampfn{ssh,user@@remotehost,/etc} $} sudo find-file shadow @key{RET}
2522#<buffer shadow> 2489#<buffer shadow>
2523 2490
2524@b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET} 2491@b{@trampfn{ssh,user@@remotehost,/etc} $} su - @key{RET}
2525@b{@trampfn{su, root, remotehost, /root} $} id @key{RET} 2492@b{@trampfn{su,root@@remotehost,/root} $} id @key{RET}
2526uid=0(root) gid=0(root) groups=0(root) 2493uid=0(root) gid=0(root) groups=0(root)
2527@b{@trampfn{su, root, remotehost, /root} $} 2494@b{@trampfn{su,root@@remotehost,/root} $}
2528@end example 2495@end example
2529 2496
2530 2497
@@ -2543,11 +2510,11 @@ with a remote file name:
2543 2510
2544@example 2511@example
2545@kbd{M-x gdb @key{RET}} 2512@kbd{M-x gdb @key{RET}}
2546@b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, ~/myprog} @key{RET} 2513@b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh,host,~/myprog} @key{RET}
2547@end example 2514@end example
2548 2515
2549Relative file names are based on the remote default directory. When 2516Relative file names are based on the remote default directory. When
2550@file{myprog.pl} exists in @file{@trampfn{ssh, , host, /home/user}}, 2517@file{myprog.pl} exists in @file{@trampfn{ssh,host,/home/user}},
2551valid calls include: 2518valid calls include:
2552 2519
2553@example 2520@example
@@ -2602,8 +2569,9 @@ To open @command{powershell} as a remote shell, use this:
2602This command flushes all connection related objects. @option{vec} is 2569This command flushes all connection related objects. @option{vec} is
2603the internal representation of a remote connection. When called 2570the internal representation of a remote connection. When called
2604interactively, this command lists active remote connections in the 2571interactively, this command lists active remote connections in the
2605minibuffer. Each connection is of the format @file{@trampfn{method, 2572minibuffer. Each connection is of the format
2606user, host, }}. Flushing remote connections also cleans the password 2573@file{@trampfn{method,user@@host,}}. Flushing remote connections also
2574cleans the password
2607cache (@pxref{Password handling}), file cache, connection cache 2575cache (@pxref{Password handling}), file cache, connection cache
2608(@pxref{Connection caching}), and connection buffers. 2576(@pxref{Connection caching}), and connection buffers.
2609@end deffn 2577@end deffn
@@ -3058,7 +3026,7 @@ HISTFILE=/dev/null
3058How to shorten long file names when typing in @value{tramp}? 3026How to shorten long file names when typing in @value{tramp}?
3059 3027
3060Adapt several of these approaches to reduce typing. If the full name 3028Adapt several of these approaches to reduce typing. If the full name
3061is @file{@trampfn{ssh, news, news.my.domain, /opt/news/etc}}, then: 3029is @file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, then:
3062 3030
3063@enumerate 3031@enumerate
3064 3032
@@ -3073,11 +3041,11 @@ You can define default methods and user names for hosts,
3073 tramp-default-user "news") 3041 tramp-default-user "news")
3074@end lisp 3042@end lisp
3075 3043
3076The reduced typing: @kbd{C-x C-f @trampfn{, , news.my.domain, /opt/news/etc}}. 3044The reduced typing: @kbd{C-x C-f @trampf{news.my.domain,/opt/news/etc}}.
3077 3045
3078@strong{Note} that there are some useful shortcuts already. Accessing 3046@strong{Note} that there are some useful shortcuts already. Accessing
3079your local host as @samp{root} user, is possible just by @kbd{C-x C-f 3047your local host as @samp{root} user, is possible just by @kbd{C-x C-f
3080@trampfn{su, , ,}}. 3048@trampfn{su,,}}.
3081 3049
3082@item 3050@item
3083Use configuration options of the access method: 3051Use configuration options of the access method:
@@ -3092,7 +3060,7 @@ Host xy
3092 User news 3060 User news
3093@end example 3061@end example
3094 3062
3095The reduced typing: @kbd{C-x C-f @trampfn{ssh, , xy, /opt/news/etc}}. 3063The reduced typing: @kbd{C-x C-f @trampfn{ssh,xy,/opt/news/etc}}.
3096 3064
3097Depending on the number of files in the directories, host names 3065Depending on the number of files in the directories, host names
3098completion can further reduce key strokes: @kbd{C-x C-f 3066completion can further reduce key strokes: @kbd{C-x C-f
@@ -3106,7 +3074,7 @@ the minibuffer. Environment variables are set either outside Emacs or
3106inside Emacs with Lisp: 3074inside Emacs with Lisp:
3107 3075
3108@lisp 3076@lisp
3109(setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}") 3077(setenv "xy" "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")
3110@end lisp 3078@end lisp
3111 3079
3112The reduced typing: @kbd{C-x C-f $xy @key{RET}}. 3080The reduced typing: @kbd{C-x C-f $xy @key{RET}}.
@@ -3127,7 +3095,7 @@ Redefine another key sequence in Emacs for @kbd{C-x C-f}:
3127 (find-file 3095 (find-file
3128 (read-file-name 3096 (read-file-name
3129 "Find Tramp file: " 3097 "Find Tramp file: "
3130 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))) 3098 "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))))
3131@end lisp 3099@end lisp
3132 3100
3133Simply typing @kbd{C-x C-y} would prepare minibuffer editing of file 3101Simply typing @kbd{C-x C-y} would prepare minibuffer editing of file
@@ -3144,7 +3112,7 @@ Abbreviation list expansion can be used to reduce typing long file names:
3144@lisp 3112@lisp
3145(add-to-list 3113(add-to-list
3146 'directory-abbrev-alist 3114 'directory-abbrev-alist
3147 '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) 3115 '("^/xy" . "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
3148@end lisp 3116@end lisp
3149 3117
3150The reduced typing: @kbd{C-x C-f /xy @key{RET}}. 3118The reduced typing: @kbd{C-x C-f /xy @key{RET}}.
@@ -3161,7 +3129,7 @@ minibuffer:
3161 3129
3162@lisp 3130@lisp
3163(define-abbrev-table 'my-tramp-abbrev-table 3131(define-abbrev-table 'my-tramp-abbrev-table
3164 '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))) 3132 '(("xy" "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")))
3165 3133
3166(add-hook 3134(add-hook
3167 'minibuffer-setup-hook 3135 'minibuffer-setup-hook
@@ -3221,7 +3189,7 @@ directory to the cache:
3221@lisp 3189@lisp
3222(eval-after-load "filecache" 3190(eval-after-load "filecache"
3223 '(file-cache-add-directory 3191 '(file-cache-add-directory
3224 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) 3192 "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
3225@end lisp 3193@end lisp
3226 3194
3227Then use directory completion in the minibuffer with @kbd{C-x C-f 3195Then use directory completion in the minibuffer with @kbd{C-x C-f
@@ -3266,11 +3234,10 @@ Why saved multi-hop file names do not work in a new Emacs session?
3266When saving ad-hoc multi-hop @value{tramp} file names (@pxref{Ad-hoc 3234When saving ad-hoc multi-hop @value{tramp} file names (@pxref{Ad-hoc
3267multi-hops}) via bookmarks, recent files, filecache, bbdb, or another 3235multi-hops}) via bookmarks, recent files, filecache, bbdb, or another
3268package, use the full ad-hoc file name including all hops, like 3236package, use the full ad-hoc file name including all hops, like
3269@file{@trampfn{ssh, bird, bastion|ssh@value{postfixhop}news.my.domain, 3237@file{@trampfn{ssh,bird@@bastion|ssh@value{postfixhop}news.my.domain,/opt/news/etc}}.
3270/opt/news/etc}}.
3271 3238
3272Alternatively, when saving abbreviated multi-hop file names 3239Alternatively, when saving abbreviated multi-hop file names
3273@file{@trampfn{ssh, news, news.my.domain, /opt/news/etc}}, the custom 3240@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, the custom
3274option @code{tramp-save-ad-hoc-proxies} must be set non-@code{nil} 3241option @code{tramp-save-ad-hoc-proxies} must be set non-@code{nil}
3275value. 3242value.
3276 3243
@@ -3302,7 +3269,7 @@ location.
3302Then start Emacs Client from the command line: 3269Then start Emacs Client from the command line:
3303 3270
3304@example 3271@example
3305emacsclient @trampfn{ssh, user, host, /file/to/edit} 3272emacsclient @trampfn{ssh,user@@host,/file/to/edit}
3306@end example 3273@end example
3307 3274
3308@code{user} and @code{host} refer to the local host. 3275@code{user} and @code{host} refer to the local host.
@@ -3312,7 +3279,7 @@ script @file{emacsclient.sh}:
3312 3279
3313@example 3280@example
3314#!/bin/sh 3281#!/bin/sh
3315emacsclient @trampfn{ssh, $(whoami), $(hostname --fqdn), $1} 3282emacsclient @trampfn{ssh,$(whoami)@@$(hostname --fqdn),$1}
3316@end example 3283@end example
3317 3284
3318Then change the environment variable @env{EDITOR} to point to the 3285Then change the environment variable @env{EDITOR} to point to the