aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Großjohann2002-07-14 14:06:58 +0000
committerKai Großjohann2002-07-14 14:06:58 +0000
commit92eeeafc5446063e2c8fbdc5fdd0a6866e421058 (patch)
treee0be01a1d4e5457166b80b881a4f6c0aada7f0fb
parent4bc65152ebd086e14758366823c3328b06b26b3e (diff)
downloademacs-92eeeafc5446063e2c8fbdc5fdd0a6866e421058.tar.gz
emacs-92eeeafc5446063e2c8fbdc5fdd0a6866e421058.zip
Comply with Texinfo coding standards. Suggestions by Eli.
-rw-r--r--man/tramp.texi595
1 files changed, 390 insertions, 205 deletions
diff --git a/man/tramp.texi b/man/tramp.texi
index a081e8812a9..16a9dd17fb0 100644
--- a/man/tramp.texi
+++ b/man/tramp.texi
@@ -10,6 +10,7 @@
10 10
11 11
12@c Entries for @command{install-info} to use 12@c Entries for @command{install-info} to use
13@dircategory Emacs
13@direntry 14@direntry
14* TRAMP: (tramp). Transparent Remote Access, Multiple Protocol 15* TRAMP: (tramp). Transparent Remote Access, Multiple Protocol
15 Emacs remote file access via rsh and rcp. 16 Emacs remote file access via rsh and rcp.
@@ -21,36 +22,33 @@
21@end macro 22@end macro
22 23
23@c Copying permissions, et al 24@c Copying permissions, et al
24@ifinfo 25@copying
25This file documents @tramp{}, a remote file editing package for Emacs and 26This file documents @tramp{}, a remote file editing package for Emacs and
26XEmacs. 27XEmacs.
27 28
28Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software 29Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software
29Foundation, Inc. 30Foundation, Inc.
30 31
31Permission is granted to make and distribute verbatim copies of this 32@quotation
32manual provided the copyright notice and this permission notice are 33Permission is granted to copy, distribute and/or modify this document
33preserved on all copies. 34under the terms of the GNU Free Documentation License, Version 1.1 or
34 35any later version published by the Free Software Foundation; with no
35@ignore 36Invariant Sections, with the Front-Cover texts being ``A GNU
36Permission is granted to process this file through TeX and print the 37Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
37results, provided the printed document carries a copying permission 38license is included in the section entitled ``GNU Free Documentation
38notice identical to this one except for the removal of this paragraph 39License'' in the Emacs manual.
39(this paragraph not being relevant to the printed manual). 40
40 41(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
41@end ignore 42this GNU Manual, like GNU software. Copies published by the Free
42Permission is granted to copy and distribute modified versions of this 43Software Foundation raise funds for GNU development.''
43manual under the conditions for verbatim copying, provided also that the 44
44sections entitled ``Copying'' and ``GNU General Public License'' are 45This document is part of a collection distributed under the GNU Free
45included exactly as in the original, and provided that the entire 46Documentation License. If you want to distribute this document
46resulting derived work is distributed under the terms of a permission 47separately from the collection, you can do so by adding a copy of the
47notice identical to this one. 48license to the document, as described in section 6 of the license.
48 49@end quotation
49Permission is granted to copy and distribute translations of this manual 50@end copying
50into another language, under the above conditions for modified versions, 51
51except that this permission notice may be stated in a translation
52approved by the Free Software Foundation.
53@end ifinfo
54 52
55@tex 53@tex
56 54
@@ -61,37 +59,20 @@ approved by the Free Software Foundation.
61@author based on documentation by Kai Gro@ss{}johann 59@author based on documentation by Kai Gro@ss{}johann
62@page 60@page
63 61
64@vskip 0pt plus 1filll
65Permission is granted to make and distribute verbatim copies of this
66manual provided the copyright notice and this permission notice are
67preserved on all copies.
68
69Permission is granted to copy and distribute modified versions of this
70manual under the conditions for verbatim copying, provided also that the
71sections entitled ``Copying'' and ``GNU General Public License'' are
72included exactly as in the original, and provided that the entire
73resulting derived work is distributed under the terms of a permission
74notice identical to this one.
75
76Permission is granted to copy and distribute translations of this manual
77into another language, under the above conditions for modified versions,
78except that this permission notice may be stated in a translation
79approved by the Free Software Foundation.
80
81@end titlepage 62@end titlepage
82@page 63@page
83 64
84@end tex 65@end tex
85 66
86@ifnottex 67@ifnottex
87@node Top, Copying, (dir), (dir) 68@node Top, Overview, (dir), (dir)
88@top @tramp{} User Manual 69@top @tramp{} User Manual
89 70
90@tramp{} stands for `Transparent Remote (file) Access, Multiple 71@tramp{} stands for `Transparent Remote (file) Access, Multiple
91Protocol'. This package provides remote file editing, similar to 72Protocol'. This package provides remote file editing, similar to
92@cite{ange-ftp} and @cite{EFS}. 73@cite{Ange-FTP} and @cite{EFS}.
93 74
94The difference is that ange-ftp uses FTP to transfer files between the 75The difference is that Ange-FTP uses FTP to transfer files between the
95local and the remote host, whereas @tramp{} uses a combination of 76local and the remote host, whereas @tramp{} uses a combination of
96@command{rsh} and @command{rcp} or other work-alike programs, such as 77@command{rsh} and @command{rcp} or other work-alike programs, such as
97@command{ssh}/@command{scp}. 78@command{ssh}/@command{scp}.
@@ -120,7 +101,6 @@ well as the usual Savannah archives.
120@end ifnottex 101@end ifnottex
121 102
122@menu 103@menu
123* Copying:: @tramp{} Copying conditions.
124* Overview:: What @tramp{} can and cannot do. 104* Overview:: What @tramp{} can and cannot do.
125 105
126For the end user: 106For the end user:
@@ -177,68 +157,50 @@ How file names, directories and paths are mangled and managed.
177@end detailmenu 157@end detailmenu
178@end menu 158@end menu
179 159
180@node Copying
181@chapter @tramp{} Copying conditions
182
183Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
184
185tramp.el is free software; you can redistribute it and/or modify it under
186the terms of the GNU General Public License as published by the Free
187Software Foundation; either version 2, or (at your option) any later
188version.
189
190tramp.el is distributed in the hope that it will be useful, but WITHOUT
191ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
192FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
193more details.
194
195You should have received a copy of the GNU General Public License along
196with GNU Emacs; see the file COPYING. If not, write to the Free Software
197Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
198USA.
199
200 160
201@node Overview 161@node Overview
202@chapter An overview of @tramp 162@chapter An overview of @tramp
163@cindex overview
203 164
204After the installation of @tramp{} into your Emacs, you will be able to 165After the installation of @tramp{} into your Emacs, you will be able
205access files on remote machines as though they were local. Access to the 166to access files on remote machines as though they were local. Access
206remote file system for editing files, version control, and 167to the remote file system for editing files, version control, and
207@command{dired} are transparently enabled. 168@command{dired} are transparently enabled.
208 169
209Your access to the remote machine can be with the @command{rsh}, 170Your access to the remote machine can be with the @command{rsh},
210@command{rlogin}, @command{telnet} programs or with any similar 171@command{rlogin}, @command{telnet} programs or with any similar
211connection method. This connection must pass ASCII successfully to be 172connection method. This connection must pass ASCII successfully to be
212usable but need not be 8-bit clean. 173usable but need not be 8-bit clean.
213 174
214The package provides support for @command{ssh} connections out of the 175The package provides support for @command{ssh} connections out of the
215box, one of the more common uses of the package. This allows relatively 176box, one of the more common uses of the package. This allows
216secure access to machines, especially if @command{ftp} access is 177relatively secure access to machines, especially if @command{ftp}
217disabled. 178access is disabled.
218 179
219The majority of activity carried out by @tramp{} requires only that the 180The majority of activity carried out by @tramp{} requires only that
220remote login is possible and is carried out at the terminal. In order to 181the remote login is possible and is carried out at the terminal. In
221access remote files @tramp{} needs to transfer their content to the local 182order to access remote files @tramp{} needs to transfer their content
222machine temporarily. 183to the local machine temporarily.
223 184
224@tramp{} can transfer files between the machines in a variety of ways. The 185@tramp{} can transfer files between the machines in a variety of ways.
225details are easy to select, depending on your needs and the machines in 186The details are easy to select, depending on your needs and the
226question. 187machines in question.
227 188
228The fastest transfer methods rely on a remote file transfer package such 189The fastest transfer methods (for large files) rely on a remote file
229as @command{rcp}, @command{scp} or @command{rsync}. The use of these 190transfer package such as @command{rcp}, @command{scp} or
230methods is only possible if the file copy command does not ask for a 191@command{rsync}. The use of these methods is only possible if the
231password for the remote machine. 192file copy command does not ask for a password for the remote machine.
232 193
233If the remote copy methods are not suitable for you, @tramp{} also 194If the remote copy methods are not suitable for you, @tramp{} also
234supports the use of encoded transfers directly through the shell. This 195supports the use of encoded transfers directly through the shell.
235requires that the @command{mimencode} or @command{uuencode} tools are 196This requires that the @command{mimencode} or @command{uuencode} tools
236available on the remote machine. 197are available on the remote machine. These methods are generally
198faster for small files.
237 199
238Within these limitations, @tramp{} is quite powerful. It is worth noting 200Within these limitations, @tramp{} is quite powerful. It is worth
239that, as of the time of writing, it is far from a polished end-user 201noting that, as of the time of writing, it is far from a polished
240product. For a while yet you should expect to run into rough edges and 202end-user product. For a while yet you should expect to run into rough
241problems with the code now and then. 203edges and problems with the code now and then.
242 204
243It is finished enough that the developers use it for day to day work but 205It is finished enough that the developers use it for day to day work but
244the installation and setup can be a little difficult to master, as can 206the installation and setup can be a little difficult to master, as can
@@ -250,6 +212,7 @@ trivial or major, should be reported to the @tramp{} developers.
250 212
251 213
252@subsubheading Behind the scenes 214@subsubheading Behind the scenes
215@cindex behind the scenes
253 216
254This section tries to explain what goes on behind the scenes when you 217This section tries to explain what goes on behind the scenes when you
255access a remote file through @tramp{}. 218access a remote file through @tramp{}.
@@ -261,11 +224,11 @@ what happens:
261 224
262@itemize 225@itemize
263@item 226@item
264@tramp{} discovers that it needs a connection to the host. So it invokes 227@tramp{} discovers that it needs a connection to the host. So it
265@command{telnet HOST} or @command{rsh HOST -l USER} or a similar tool to 228invokes @samp{telnet @var{host}} or @samp{rsh @var{host} -l
266connect to the remote host. Communication with this process happens 229@var{user}} or a similar tool to connect to the remote host.
267through an Emacs buffer, that is, the output from the remote end goes 230Communication with this process happens through an Emacs buffer, that
268into a buffer. 231is, the output from the remote end goes into a buffer.
269 232
270@item 233@item
271The remote host may prompt for a login name (for @command{telnet}). The 234The remote host may prompt for a login name (for @command{telnet}). The
@@ -297,7 +260,7 @@ Suppose that the login was successful and @tramp{} sees the shell prompt
297from the remote host. Now @tramp{} invokes @command{/bin/sh} because 260from the remote host. Now @tramp{} invokes @command{/bin/sh} because
298Bourne shells and C shells have different command 261Bourne shells and C shells have different command
299syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login 262syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login
300shell doesn't recognize @command{exec /bin/sh} as a valid command. 263shell doesn't recognize @samp{exec /bin/sh} as a valid command.
301Maybe you use the Scheme shell @command{scsh}@dots{}} 264Maybe you use the Scheme shell @command{scsh}@dots{}}
302 265
303After the Bourne shell has come up, @tramp{} sends a few commands to 266After the Bourne shell has come up, @tramp{} sends a few commands to
@@ -323,12 +286,12 @@ that you can edit them.
323 286
324See above for an explanation of how @tramp{} transfers the file contents. 287See above for an explanation of how @tramp{} transfers the file contents.
325 288
326For inline transfers, @tramp{} issues a command like @command{mimencode -b 289For inline transfers, @tramp{} issues a command like @samp{mimencode -b
327/path/to/remote/file}, waits until the output has accumulated in the 290/path/to/remote/file}, waits until the output has accumulated in the
328buffer that's used for communication, then decodes that output to 291buffer that's used for communication, then decodes that output to
329produce the file contents. 292produce the file contents.
330 293
331For out-of-band transfers, @tramp{} issues a command like @command{rcp 294For out-of-band transfers, @tramp{} issues a command like @samp{rcp
332user@@host:/path/to/remote/file /tmp/tramp.4711} and then reads the local 295user@@host:/path/to/remote/file /tmp/tramp.4711} and then reads the local
333temporary file @file{/tmp/tramp.4711} into a buffer and deletes the 296temporary file @file{/tmp/tramp.4711} into a buffer and deletes the
334temporary file. 297temporary file.
@@ -352,14 +315,18 @@ behind the scenes when you open a file with @tramp{}.
352@c For the end user 315@c For the end user
353@node Obtaining @tramp{} 316@node Obtaining @tramp{}
354@chapter Obtaining @tramp{}. 317@chapter Obtaining @tramp{}.
318@cindex obtaining Tramp
355 319
356@tramp{} is freely available on the Internet and the latest release may be 320@tramp{} is freely available on the Internet and the latest release may be
357downloaded from 321downloaded from
358@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}. This 322@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}. This
359release includes the full documentation and code for @tramp{}, suitable 323release includes the full documentation and code for @tramp{}, suitable
360for installation. 324for installation. But Emacs (21.4 or later) includes @tramp{}
325already, and there is a @tramp{} package for XEmacs, as well. So
326maybe it is easier to just use those. But if you want the bleeding
327edge, read on@dots{...}
361 328
362For the especially brave, @tramp{} is available from CVS. The CVS version 329For the especially brave, @tramp{} is available from CVS. The CVS version
363is the latest version of the code and may contain incomplete features or 330is the latest version of the code and may contain incomplete features or
364new issues. Use these versions at your own risk. 331new issues. Use these versions at your own risk.
365 332
@@ -392,24 +359,30 @@ by issuing the command:
392 359
393@node History 360@node History
394@chapter History of @tramp{} 361@chapter History of @tramp{}
362@cindex history
363@cindex development history
395 364
396Development was started end of November 1998. The package was called 365Development was started end of November 1998. The package was called
397`rssh.el', back then. It only provided one method to access a file, 366@file{rssh.el}, back then. It only provided one method to access a
398using @command{ssh} to log in to a remote host and using @command{scp} 367file, using @command{ssh} to log in to a remote host and using
399to transfer the file contents. After a while, the name was changed to 368@command{scp} to transfer the file contents. After a while, the name
400`rcp.el', and now it's @tramp{}. Along the way, many more methods for 369was changed to @file{rcp.el}, and now it's @tramp{}. Along the way,
401getting a remote shell and for transferring the file contents were 370many more methods for getting a remote shell and for transferring the
402added. Support for VC was added. 371file contents were added. Support for VC was added.
403 372
404The most recent addition of a major feature was the multi-hop methods 373The most recent addition of major features were the multi-hop methods
405added in April 2000. 374added in April 2000 and the unification of @tramp{} and Ange-FTP
375filenames in July 2002.
406 376
407 377
408@node Installation 378@node Installation
409@chapter Installing @tramp{} into Emacs or XEmacs 379@chapter Installing @tramp{} into Emacs or XEmacs
380@cindex installation
410 381
411Installing @tramp{} into your Emacs or XEmacs is a relatively easy 382If you use the version that comes with your Emacs or the XEmacs
412process, at least compared to rebuilding your machine from scratch. ;) 383package, the following information is not necessary. Installing
384@tramp{} into your Emacs or XEmacs is a relatively easy process, at
385least compared to rebuilding your machine from scratch. ;)
413 386
414Seriously though, the installation should be a fairly simple matter. 387Seriously though, the installation should be a fairly simple matter.
415 388
@@ -438,12 +411,12 @@ If you run into problems running the example @command{make}
438commands, don't dispare. You can still byte compile the 411commands, don't dispare. You can still byte compile the
439@file{*.el} files by opening emacs in @command{dired} 412@file{*.el} files by opening emacs in @command{dired}
440(@command{C-x d}) mode, at @file{~/tramp/lisp}. Mark the lisp 413(@command{C-x d}) mode, at @file{~/tramp/lisp}. Mark the lisp
441files with @command{m}, then press @command{B} to byte compile 414files with @kbd{m}, then press @kbd{B} to byte compile
442your selections. 415your selections.
443 416
444Something similar can be done to create the info manual. 417Something similar can be done to create the info manual.
445Just cd to @file{~/emacs/tramp/texi} and load the @file{tramp.texi} 418Just cd to @file{~/emacs/tramp/texi} and load the @file{tramp.texi}
446file in emacs. Then press @command{M-x makeinfo-buffer <RET>} 419file in emacs. Then press @kbd{M-x makeinfo-buffer <RET>}
447to generate @file{tramp.info}. 420to generate @file{tramp.info}.
448@end example 421@end example
449 422
@@ -467,11 +440,11 @@ NOTE:
467On systems using `gnu' @command{install-info}, the 440On systems using `gnu' @command{install-info}, the
468@command{install-info} syntax is very direct and simple. One can 441@command{install-info} syntax is very direct and simple. One can
469cd to @file{~/emacs/tramp/texi} and type: 442cd to @file{~/emacs/tramp/texi} and type:
470 @command{install-info tramp.info dir} 443 @kbd{install-info tramp.info dir}
471and a @file{dir} file will be created with the @tramp{} 444and a @file{dir} file will be created with the @tramp{}
472entry. The info reader will know how to interpret it, but must 445entry. The info reader will know how to interpret it, but must
473be told where to find it (see below). If you want anything fancier 446be told where to find it (see below). If you want anything fancier
474you'll need to look through @command{man install-info}. 447you'll need to look through @kbd{man install-info}.
475 448
476Debian gnu/linux doesn't default to `gnu' @command{install-info} and 449Debian gnu/linux doesn't default to `gnu' @command{install-info} and
477uses its own version. This version does not create a @file{dir} file 450uses its own version. This version does not create a @file{dir} file
@@ -486,7 +459,7 @@ in the @file{texi} directroy of this distribution. See
486Once a @file{dir} file is in place, this command will make the entry. 459Once a @file{dir} file is in place, this command will make the entry.
487 install-info --infodir=. tramp.info 460 install-info --infodir=. tramp.info
488If you want it in a specific category 461If you want it in a specific category
489 (see @command{man install-info} for further details) 462 (see @kbd{man install-info} for further details)
490@end example 463@end example
491 464
492If the environment variable @env{INFOPATH} is set, add the directory 465If the environment variable @env{INFOPATH} is set, add the directory
@@ -501,7 +474,7 @@ XEmacs 21 users should use @code{Info-directory-list} rather than
501@end itemize 474@end itemize
502 475
503 476
504For XEmacs users, the package @command{fsf-compat} must be installed. 477For XEmacs users, the package @file{fsf-compat} must be installed.
505For details on package installation, see @ref{Packages, , ,xemacs}. 478For details on package installation, see @ref{Packages, , ,xemacs}.
506@ifhtml 479@ifhtml
507(If the previous link doesn't work, try the XEmacs documentation at 480(If the previous link doesn't work, try the XEmacs documentation at
@@ -511,19 +484,24 @@ site}.)
511 484
512@node Configuration 485@node Configuration
513@chapter Configuring @tramp{} for use 486@chapter Configuring @tramp{} for use
487@cindex configuration
514 488
489@cindex default configuration
515@tramp{} is (normally) fully functional when it is initially 490@tramp{} is (normally) fully functional when it is initially
516installed. It is initially configured to use the @command{rsh} and 491installed. It is initially configured to use the @command{sh} program
517@command{rcp} programs to connect to the remote host. 492to connect to the remote host and to use base-64 encoding (on the
493remote host, via @command{mimencode}, and on the local host via the
494built-in support for base-64 encoding in Emacs).
518 495
519On some hosts, there are problems with opening a connection. These are 496On some hosts, there are problems with opening a connection. These are
520related to the behavior of the remote shell. See @xref{Remote shell 497related to the behavior of the remote shell. See @xref{Remote shell
521setup}, for details on this. 498setup}, for details on this.
522 499
523If you do not wish to use these commands to connect to the remote host, 500If you do not wish to use these commands to connect to the remote
524you should change the default connection and transfer method that @tramp 501host, you should change the default connection and transfer method
525uses. There are several different methods that @tramp{} can use to 502that @tramp uses. There are several different methods that @tramp{}
526connect to remote machines and transfer files (@pxref{Connection types}). 503can use to connect to remote machines and transfer files
504(@pxref{Connection types}).
527 505
528 506
529@menu 507@menu
@@ -541,9 +519,10 @@ connect to remote machines and transfer files (@pxref{Connection types}).
541 519
542@node Connection types 520@node Connection types
543@section Types of connections made to remote machines. 521@section Types of connections made to remote machines.
522@cindex connection types, overview
544 523
545There are two basic types of transfer methods, each with its own 524There are two basic types of transfer methods, each with its own
546advantages and limitations. Both types of connection make use of a 525advantages and limitations. Both types of connection make use of a
547remote shell access program such as @command{rsh}, @command{ssh} or 526remote shell access program such as @command{rsh}, @command{ssh} or
548@command{telnet} to connect to the remote machine. 527@command{telnet} to connect to the remote machine.
549 528
@@ -552,17 +531,26 @@ requires to make the remote file system transparently accessible from
552the local machine. It is only when visiting files that the methods 531the local machine. It is only when visiting files that the methods
553differ. 532differ.
554 533
555Loading or saving a remote file requires that the content of the file be 534@cindex inline methods
556transfered between the two machines. The content of the file can be 535@cindex external transfer methods
557transfered over the same connection used to log in to the remote machine 536@cindex external methods
558or the file can be transfered through another connection using a remote 537@cindex out-of-band methods
559copy program such as @command{rcp}, @command{scp} or @command{rsync}. 538@cindex methods, inline
560The former are called @dfn{inline methods}, the latter are called 539@cindex methods, external transfer
561@dfn{external transfer methods}. 540@cindex methods, out-of-band
541Loading or saving a remote file requires that the content of the file
542be transfered between the two machines. The content of the file can be
543transfered over the same connection used to log in to the remote
544machine or the file can be transfered through another connection using
545a remote copy program such as @command{rcp}, @command{scp} or
546@command{rsync}. The former are called @dfn{inline methods}, the
547latter are called @dfn{out-of-band methods} or @dfn{external transfer
548methods} (@dfn{external methods} for short).
562 549
563The performance of the external transfer methods is generally better 550The performance of the external transfer methods is generally better
564than that of the inline methods. This is caused by the need to encode 551than that of the inline methods, at least for large files. This is
565and decode the data when transferring inline. 552caused by the need to encode and decode the data when transferring
553inline.
566 554
567The one exception to this rule are the @command{scp} based transfer 555The one exception to this rule are the @command{scp} based transfer
568methods. While these methods do see better performance when actually 556methods. While these methods do see better performance when actually
@@ -574,6 +562,8 @@ interactive --- that is, the command does not prompt you for a password.
574If you cannot perform remote copies without a password, you will need to 562If you cannot perform remote copies without a password, you will need to
575use an inline transfer method to work with @tramp{}. 563use an inline transfer method to work with @tramp{}.
576 564
565@cindex multi-hop methods
566@cindex methods, multi-hop
577A variant of the inline methods are the @dfn{multi-hop methods}. 567A variant of the inline methods are the @dfn{multi-hop methods}.
578These methods allow you to connect a remote host using a number `hops', 568These methods allow you to connect a remote host using a number `hops',
579each of which connects to a different host. This is useful if you are 569each of which connects to a different host. This is useful if you are
@@ -583,6 +573,8 @@ connect to the outside world.
583 573
584@node Inline methods 574@node Inline methods
585@section Inline methods 575@section Inline methods
576@cindex inline methods
577@cindex methods, inline
586 578
587The inline methods in @tramp{} are quite powerful and can work in 579The inline methods in @tramp{} are quite powerful and can work in
588situations where you cannot use an external transfer program to connect. 580situations where you cannot use an external transfer program to connect.
@@ -592,23 +584,29 @@ allow you to transfer files between @emph{user identities} rather than
592hosts, see below.) 584hosts, see below.)
593 585
594These methods depend on the existence of a suitable encoding and 586These methods depend on the existence of a suitable encoding and
595decoding command on remote machine. Locally, @tramp{} may be able to use 587decoding command on remote machine. Locally, @tramp{} may be able to use
596features of Emacs to decode and encode the files or it may require 588features of Emacs to decode and encode the files or it may require
597access to external commands to perform that task. 589access to external commands to perform that task.
598 590
599@tramp{} supports the use of @command{uuencode} to transfer files. This is 591@cindex uuencode
600@emph{not} recommended. The @command{uuencode} and @command{uudecode} 592@tramp{} supports the use of @command{uuencode} to transfer files.
601commands are not well standardized and may not function correctly or at 593This is @emph{not} recommended. The @command{uuencode} and
602all on some machines, notably AIX and IRIX. These systems do not work 594@command{uudecode} commands are not well standardized and may not
603with @command{uuencode} at all. (But do see the note about AIX in the 595function correctly or at all on some machines, notably AIX and IRIX.
604documentation for @var{tramp-methods}.) 596These systems do not work with @command{uuencode} at all. (But do see
597the note about AIX in the documentation for @var{tramp-methods}.)
605 598
599@cindex mimencode
600@cindex base-64 encoding
606In summary, if possible use the @command{mimencode} methods to transfer 601In summary, if possible use the @command{mimencode} methods to transfer
607the data base64 encoded. This has the advantage of using a built-in 602the data base64 encoded. This has the advantage of using a built-in
608command in every modern Emacs, improving performance. 603command in every modern Emacs, improving performance.
609 604
610@itemize 605@table @asis
611@item @option{rm} --- @command{rsh} with @command{mimencode} 606@item @option{rm} --- @command{rsh} with @command{mimencode}
607@cindex method rm
608@cindex rm method
609@cindex method using rsh
612 610
613Connect to the remote host with @command{rsh} and use base64 encoding to 611Connect to the remote host with @command{rsh} and use base64 encoding to
614transfer files between the machines. 612transfer files between the machines.
@@ -619,6 +617,12 @@ machines.
619 617
620 618
621@item @option{sm} --- @command{ssh} with @command{mimencode} 619@item @option{sm} --- @command{ssh} with @command{mimencode}
620@cindex method sm
621@cindex sm method
622@cindex method using ssh
623@cindex ssh
624@cindex mimencode
625@cindex base-64 encoding
622 626
623Connect to the remote host with @command{ssh} and use base64 encoding to 627Connect to the remote host with @command{ssh} and use base64 encoding to
624transfer files between the machines. 628transfer files between the machines.
@@ -638,6 +642,12 @@ arguments to the @command{ssh} command.
638 642
639 643
640@item @option{tm} --- @command{telnet} with @command{mimencode} 644@item @option{tm} --- @command{telnet} with @command{mimencode}
645@cindex method tm
646@cindex tm method
647@cindex method using telnet
648@cindex telnet
649@cindex mimencode
650@cindex base-64 encoding
641 651
642Connect to the remote host with @command{telnet} and use base64 encoding 652Connect to the remote host with @command{telnet} and use base64 encoding
643to transfer files between the machines. 653to transfer files between the machines.
@@ -647,6 +657,11 @@ This requires the @command{mimencode} command that is part of the
647 657
648 658
649@item @option{ru} --- @command{rsh} with @command{uuencode} 659@item @option{ru} --- @command{rsh} with @command{uuencode}
660@cindex method ru
661@cindex ru method
662@cindex method using rsh
663@cindex rsh
664@cindex uuencode
650 665
651Connect to the remote host with @command{rsh} and use the 666Connect to the remote host with @command{rsh} and use the
652@command{uuencode} and @command{uudecode} commands to transfer files 667@command{uuencode} and @command{uudecode} commands to transfer files
@@ -654,6 +669,11 @@ between the machines.
654 669
655 670
656@item @option{su} --- @command{ssh} with @command{uuencode} 671@item @option{su} --- @command{ssh} with @command{uuencode}
672@cindex method su
673@cindex su method
674@cindex method using ssh
675@cindex ssh
676@cindex uuencode
657 677
658Connect to the remote host with @command{ssh} and use the 678Connect to the remote host with @command{ssh} and use the
659@command{uuencode} and @command{uudecode} commands to transfer files 679@command{uuencode} and @command{uudecode} commands to transfer files
@@ -666,10 +686,15 @@ select an ssh version.
666Note that this method does not invoke the @command{su} program, see 686Note that this method does not invoke the @command{su} program, see
667below for methods which use that. 687below for methods which use that.
668 688
669This supports the @command{-p} kludge. 689This supports the @samp{-p} kludge.
670 690
671 691
672@item @option{tu} --- @command{telnet} with @command{uuencode} 692@item @option{tu} --- @command{telnet} with @command{uuencode}
693@cindex tu method
694@cindex method tu
695@cindex method using telnet
696@cindex telnet
697@cindex uuencode
673 698
674Connect to the remote host with @command{telnet} and use the 699Connect to the remote host with @command{telnet} and use the
675@command{uuencode} and @command{uudecode} commands to transfer files 700@command{uuencode} and @command{uudecode} commands to transfer files
@@ -677,6 +702,12 @@ between the machines.
677 702
678 703
679@item @option{sum} --- @command{su} with @command{mimencode} 704@item @option{sum} --- @command{su} with @command{mimencode}
705@cindex method sum
706@cindex sum method
707@cindex method using su
708@cindex su
709@cindex mimencode
710@cindex base-64 encoding
680 711
681This method does not connect to a remote host at all, rather it uses the 712This method does not connect to a remote host at all, rather it uses the
682@command{su} program to allow you to edit files as another user. Uses 713@command{su} program to allow you to edit files as another user. Uses
@@ -684,6 +715,11 @@ base64 encoding to transfer the file contents.
684 715
685 716
686@item @option{suu} --- @command{su} with @command{uuencode} 717@item @option{suu} --- @command{su} with @command{uuencode}
718@cindex method suu
719@cindex suu method
720@cindex method using su
721@cindex su
722@cindex uuencode
687 723
688Like @option{sum}, this uses the @command{su} program to allow you to 724Like @option{sum}, this uses the @command{su} program to allow you to
689edit files on the local host as another user. Uses @command{uuencode} 725edit files on the local host as another user. Uses @command{uuencode}
@@ -691,6 +727,12 @@ and @command{uudecode} to transfer the file contents.
691 727
692 728
693@item @option{sudm} --- @command{sudo} with @command{mimencode} 729@item @option{sudm} --- @command{sudo} with @command{mimencode}
730@cindex method sudm
731@cindex sudm method
732@cindex method using sudo
733@cindex sudo
734@cindex mimencode
735@cindex base-64 encoding
694 736
695This is similar to the @option{sum} method, but it uses @command{sudo} 737This is similar to the @option{sum} method, but it uses @command{sudo}
696rather than @command{su} to become a different user. 738rather than @command{su} to become a different user.
@@ -702,20 +744,33 @@ to implement, so I haven't got around to it, yet.
702 744
703 745
704@item @option{sudu} --- @command{sudo} with @command{uuencode} 746@item @option{sudu} --- @command{sudo} with @command{uuencode}
747@cindex method sudu
748@cindex sudu method
749@cindex method using sudo
750@cindex sudo
751@cindex uuencode
705 752
706This is similar to the @option{suu} method, but it uses @command{sudo} 753This is similar to the @option{suu} method, but it uses @command{sudo}
707rather than @command{su} to become a different user. 754rather than @command{su} to become a different user.
708 755
709 756
710@item @option{smx} --- @command{ssh} with @command{mimencode} 757@item @option{smx} --- @command{ssh} with @command{mimencode}
758@cindex method smx
759@cindex smx method
760@cindex method using ssh
761@cindex ssh
762@cindex mimencode
763@cindex base-64 encoding
764@cindex Cygwin
711 765
712As you expect, this is similar to @option{sm}, only a little 766As you expect, this is similar to @option{sm}, only a little
713different. Whereas @option{sm} opens a normal interactive shell on 767different. Whereas @option{sm} opens a normal interactive shell on
714the remote host, this option uses @command{ssh -t -t HOST -l USER 768the remote host, this option uses @samp{ssh -t -t @var{host} -l
715/bin/sh} tp open a connection. This is useful for users where the 769@var{user} /bin/sh} tp open a connection. This is useful for users
716normal login shell is set up to ask them a number of questions when 770where the normal login shell is set up to ask them a number of
717logging in. This procedure avoids these questions, and just gives 771questions when logging in. This procedure avoids these questions, and
718@tramp{} a more-or-less `standard' login shell to work with. 772just gives @tramp{} a more-or-less `standard' login shell to work
773with.
719 774
720Note that this procedure does not eliminate questions asked by 775Note that this procedure does not eliminate questions asked by
721@command{ssh} itself. For example, @command{ssh} might ask ``Are you 776@command{ssh} itself. For example, @command{ssh} might ask ``Are you
@@ -727,39 +782,62 @@ in without such questions.
727This is also useful for Windows users where @command{ssh}, when 782This is also useful for Windows users where @command{ssh}, when
728invoked from an Emacs buffer, tells them that it is not allocating a 783invoked from an Emacs buffer, tells them that it is not allocating a
729pseudo tty. When this happens, the login shell is wont to not print 784pseudo tty. When this happens, the login shell is wont to not print
730any shell prompt, which confuses @tramp{} mightily. 785any shell prompt, which confuses @tramp{} mightily. For reasons
786unknown, some Windows ports for @command{ssh} (maybe the Cygwin one)
787require the doubled @samp{-t} option.
731 788
732This supports the @command{-p} kludge. 789This supports the @samp{-p} kludge.
733 790
734 791
735@item @option{km} --- @command{krlogin} with @command{mimencode} 792@item @option{km} --- @command{krlogin} with @command{mimencode}
793@cindex method km
794@cindex km method
795@cindex krlogin
796@cindex Kerberos
797@cindex mimencode
798@cindex base-64 encoding
736 799
737This method is also similar to @option{sm}. It only uses the 800This method is also similar to @option{sm}. It only uses the
738@command{krlogin -x} command to log in to the remote host. 801@command{krlogin -x} command to log in to the remote host.
739 802
740 803
741@item @option{plinku} --- @command{plink} with @command{uuencode} 804@item @option{plinku} --- @command{plink} with @command{uuencode}
805@cindex method plinku
806@cindex plinku method
807@cindex method using plink
808@cindex plink
809@cindex uuencode
742 810
743This method is mostly interesting for Windows users using the PuTTY 811This method is mostly interesting for Windows users using the PuTTY
744implementation of SSH. It uses @command{plink -ssh} to log in to the 812implementation of SSH. It uses @samp{plink -ssh} to log in to the
745remote host. 813remote host.
746 814
747CCC: Do we have to connect to the remote host once from the command 815CCC: Do we have to connect to the remote host once from the command
748line to accept the SSH key? Maybe this can be made automatic? 816line to accept the SSH key? Maybe this can be made automatic?
749 817
750CCC: Does @command{plink} support the @command{-p} option? Tramp 818CCC: Does @command{plink} support the @samp{-p} option? Tramp
751will support that, anyway. 819will support that, anyway.
752 820
753@item @option{plinkm} --- @command{plink} with @command{mimencode} 821@item @option{plinkm} --- @command{plink} with @command{mimencode}
822@cindex method plinkm
823@cindex plinkm method
824@cindex method using plink
825@cindex plink
826@cindex mimencode
827@cindex base-64 encoding
754 828
755Like @option{plinku}, but uses base64 encoding instead of uu encoding. 829Like @option{plinku}, but uses base64 encoding instead of uu encoding.
756 830
757@end itemize 831@end table
758 832
759 833
760 834
761@node External transfer methods 835@node External transfer methods
762@section External transfer methods 836@section External transfer methods
837@cindex methods, external transfer
838@cindex methods, out-of-band
839@cindex external transfer methods
840@cindex out-of-band methods
763 841
764The external transfer methods operate through multiple channels, using 842The external transfer methods operate through multiple channels, using
765the remote shell connection for many actions while delegating file 843the remote shell connection for many actions while delegating file
@@ -772,6 +850,7 @@ If you want to use an external transfer method you @emph{must} be able
772to execute the transfer utility to copy files to and from the remote 850to execute the transfer utility to copy files to and from the remote
773machine without any interaction. 851machine without any interaction.
774 852
853@cindex ssh-agent
775This means that you will need to use @command{ssh-agent} if you use the 854This means that you will need to use @command{ssh-agent} if you use the
776@command{scp} program for transfers, or maybe your version of 855@command{scp} program for transfers, or maybe your version of
777@command{scp} accepts a password on the command line.@footnote{PuTTY's 856@command{scp} accepts a password on the command line.@footnote{PuTTY's
@@ -784,8 +863,12 @@ would still like to use @command{ssh} to secure your connection, have a
784look at the @command{ssh} based inline methods. 863look at the @command{ssh} based inline methods.
785 864
786 865
787@itemize 866@table @asis
788@item @option{rcp} --- @command{rsh} and @command{rcp} 867@item @option{rcp} --- @command{rsh} and @command{rcp}
868@cindex method rcp
869@cindex rcp method
870@cindex rcp
871@cindex rsh
789 872
790This method uses the @command{rsh} and @command{rcp} commands to connect 873This method uses the @command{rsh} and @command{rcp} commands to connect
791to the remote machine and transfer files. This is probably the fastest 874to the remote machine and transfer files. This is probably the fastest
@@ -793,6 +876,10 @@ connection method available.
793 876
794 877
795@item @option{scp} --- @command{ssh} and @command{scp} 878@item @option{scp} --- @command{ssh} and @command{scp}
879@cindex method scp
880@cindex scp method
881@cindex scp
882@cindex ssh
796 883
797Using @command{ssh} to connect to the remote host and @command{scp} to 884Using @command{ssh} to connect to the remote host and @command{scp} to
798transfer files between the machines is the best method for securely 885transfer files between the machines is the best method for securely
@@ -804,13 +891,17 @@ The cost of the cryptographic handshake at the start of an @command{scp}
804session can begin to absorb the advantage that the lack of encoding and 891session can begin to absorb the advantage that the lack of encoding and
805decoding presents. 892decoding presents.
806 893
807All the @command{ssh} based methods support the kludgy @command{-p} 894All the @command{ssh} based methods support the kludgy @samp{-p}
808feature where you can specify a port number to connect to in the host 895feature where you can specify a port number to connect to in the host
809name. For example, the host name @file{host#42} tells Tramp to 896name. For example, the host name @file{host#42} tells Tramp to
810specify @command{-p 42} in the argument list for @command{ssh}. 897specify @samp{-p 42} in the argument list for @command{ssh}.
811 898
812 899
813@item @option{rsync} --- @command{ssh} and @command{rsync} 900@item @option{rsync} --- @command{ssh} and @command{rsync}
901@cindex method rsync
902@cindex rsync method
903@cindex rsync
904@cindex ssh
814 905
815Using the @command{ssh} command to connect securely to the remote 906Using the @command{ssh} command to connect securely to the remote
816machine and the @command{rsync} command to transfer files is almost 907machine and the @command{rsync} command to transfer files is almost
@@ -824,38 +915,54 @@ The @command{rsync} based method may be considerably faster than the
824@command{rcp} based methods when writing to the remote system. Reading 915@command{rcp} based methods when writing to the remote system. Reading
825files to the local machine is no faster than with a direct copy. 916files to the local machine is no faster than with a direct copy.
826 917
827This method supports the @command{-p} hack. 918This method supports the @samp{-p} hack.
828 919
829 920
830@item @option{scpx} --- @command{ssh} and @command{scp} 921@item @option{scpx} --- @command{ssh} and @command{scp}
922@cindex method scpx
923@cindex scpx method
924@cindex scp
925@cindex ssh
926@cindex Cygwin
831 927
832As you expect, this is similar to @option{scp}, only a little 928As you expect, this is similar to @option{scp}, only a little
833different. Whereas @option{scp} opens a normal interactive shell on the 929different. Whereas @option{scp} opens a normal interactive shell on
834remote host, this option uses @command{ssh -t -t HOST -l USER /bin/sh} to 930the remote host, this option uses @samp{ssh -t -t @var{host} -l
835open a connection. This is useful for users where the normal login 931@var{user} /bin/sh} to open a connection. This is useful for users
836shell is set up to ask them a number of questions when logging in. This 932where the normal login shell is set up to ask them a number of
837procedure avoids these questions, and just gives @tramp{} a more-or-less 933questions when logging in. This procedure avoids these questions, and
838`standard' login shell to work with. 934just gives @tramp{} a more-or-less `standard' login shell to work
935with.
839 936
840This is also useful for Windows users where @command{ssh}, when 937This is also useful for Windows users where @command{ssh}, when
841invoked from an Emacs buffer, tells them that it is not allocating a 938invoked from an Emacs buffer, tells them that it is not allocating a
842pseudo tty. When this happens, the login shell is wont to not print 939pseudo tty. When this happens, the login shell is wont to not print
843any shell prompt, which confuses @tramp{} mightily. 940any shell prompt, which confuses @tramp{} mightily. Maybe this
941applies to the Cygwin port of SSH.
844 942
845This method supports the @command{-p} hack. 943This method supports the @samp{-p} hack.
846 944
847 945
848@item @option{pscp} --- @command{plink} and @command{pscp} 946@item @option{pscp} --- @command{plink} and @command{pscp}
947@cindex method pscp
948@cindex pscp method
949@cindex pscp
950@cindex plink
951@cindex PuTTY
849 952
850This method is similar to @option{scp}, but it uses the 953This method is similar to @option{scp}, but it uses the
851@command{plink} command to connect to the remote host, and it uses 954@command{plink} command to connect to the remote host, and it uses
852@command{pscp} for transferring the files. These programs are part 955@command{pscp} for transferring the files. These programs are part
853of PuTTY, an SSH implementation for Windows. 956of PuTTY, an SSH implementation for Windows.
854 957
855CCC: Does @command{plink} support the @command{-p} hack? 958CCC: Does @command{plink} support the @samp{-p} hack?
856 959
857 960
858@item @option{fcp} --- @command{fsh} and @command{fcp} 961@item @option{fcp} --- @command{fsh} and @command{fcp}
962@cindex method fcp
963@cindex fcp method
964@cindex fsh
965@cindex fcp
859 966
860This method is similar to @option{scp}, but it uses the @command{fsh} 967This method is similar to @option{scp}, but it uses the @command{fsh}
861command to connect to the remote host, and it uses @command{fcp} for 968command to connect to the remote host, and it uses @command{fcp} for
@@ -866,14 +973,21 @@ for submitting several commands. This avoids the startup overhead of
866is called). Note, however, that you can also use one of the inline 973is called). Note, however, that you can also use one of the inline
867methods to achieve a similar effect. 974methods to achieve a similar effect.
868 975
869This method uses the command @command{fsh HOST -l USER /bin/sh -i} to 976This method uses the command @samp{fsh @var{host} -l @var{user}
870establish the connection, it does not work to just say @command{fsh 977/bin/sh -i} to establish the connection, it does not work to just say
871HOST -l USER}. 978@command{fsh @var{host} -l @var{user}}.
872 979
873@end itemize 980There is no inline method using @command{fsh} as the multiplexing
981provided by the program is not very useful in our context. @tramp{}
982opens just one connection to the remote host and then keeps it open,
983anyway.
984
985@end table
874 986
875@node Multi-hop Methods 987@node Multi-hop Methods
876@section Connecting to a remote host using multiple hops 988@section Connecting to a remote host using multiple hops
989@cindex multi-hop methods
990@cindex methods, multi-hop
877 991
878Sometimes, the methods described before are not sufficient. Sometimes, 992Sometimes, the methods described before are not sufficient. Sometimes,
879it is not possible to connect to a remote host using a simple command. 993it is not possible to connect to a remote host using a simple command.
@@ -888,43 +1002,58 @@ name on the remote system. The method specifies how the file is
888transferred through the inline connection. The following two multi-hop 1002transferred through the inline connection. The following two multi-hop
889methods are available: 1003methods are available:
890 1004
891@itemize 1005@table @asis
892@item @option{multi} --- base64 encoding with @command{mimencode} 1006@item @option{multi} --- base64 encoding with @command{mimencode}
1007@cindex method multi
1008@cindex multi method
1009@cindex base-64 encoding
1010@cindex mimencode
893 1011
894The file is transferred through the connection in base64 encoding. Uses 1012The file is transferred through the connection in base64 encoding. Uses
895the @command{mimencode} program for doing encoding and decoding, but 1013the @command{mimencode} program for doing encoding and decoding, but
896uses an Emacs internal implementation on the local host if available. 1014uses an Emacs internal implementation on the local host if available.
897 1015
898@item @option{multiu} --- use commands @command{uuencode} and @command{uudecode} 1016@item @option{multiu} --- use commands @command{uuencode} and @command{uudecode}
1017@cindex method multiu
1018@cindex multiu method
1019@cindex uuencode
899 1020
900The file is transferred through the connection in `uu' encoding. Uses 1021The file is transferred through the connection in `uu' encoding. Uses
901the @command{uuencode} and @command{uudecode} programs for encoding and 1022the @command{uuencode} and @command{uudecode} programs for encoding and
902decoding, but uses a Lisp implementation for decoding on the local host 1023decoding, but uses a Lisp implementation for decoding on the local host
903if available. 1024if available.
904 1025
905@end itemize 1026@end table
906 1027
907Each hop consists of a @dfn{hop method} specification, a user name and a 1028Each hop consists of a @dfn{hop method} specification, a user name and a
908host name. The following hop methods are (currently) available: 1029host name. The following hop methods are (currently) available:
909 1030
910@itemize 1031@table @option
911@item @option{telnet} 1032@item telnet
1033@cindex hop method telnet
1034@cindex telnet hop method
912 1035
913Uses the well-known @command{telnet} program to connect to the host. 1036Uses the well-known @command{telnet} program to connect to the host.
914Whereas user name and host name are supplied in the file name, the 1037Whereas user name and host name are supplied in the file name, the
915user is queried for the password. 1038user is queried for the password.
916 1039
917@item @option{rsh} 1040@item rsh
1041@cindex hop method rsh
1042@cindex rsh hop method
918 1043
919This uses @command{rsh} to connect to the host. You do not need to 1044This uses @command{rsh} to connect to the host. You do not need to
920enter a password unless @command{rsh} explicitly asks for it. 1045enter a password unless @command{rsh} explicitly asks for it.
921 1046
922@item @option{ssh} 1047@item ssh
1048@cindex hop method ssh
1049@cindex ssh hop method
923 1050
924This uses @command{ssh} to connect to the host. You might have to enter 1051This uses @command{ssh} to connect to the host. You might have to enter
925a password or a pass phrase. 1052a password or a pass phrase.
926 1053
927@item @option{su} 1054@item su
1055@cindex hop method su
1056@cindex su hop method
928 1057
929This method does not actually contact a different host, but it allows 1058This method does not actually contact a different host, but it allows
930you to become a different user on the host you're currently on. This 1059you to become a different user on the host you're currently on. This
@@ -939,18 +1068,21 @@ Even though you @emph{must} specify both user and host with a
939@option{su} hop, the host name is ignored and only the user name is 1068@option{su} hop, the host name is ignored and only the user name is
940used. 1069used.
941 1070
942@item @option{sudo} 1071@item sudo
1072@cindex hop method sudo
1073@cindex sudo hop method
943 1074
944This is similar to the @option{su} hop, except that it uses 1075This is similar to the @option{su} hop, except that it uses
945@command{sudo} rather than @command{su} to become a different user. 1076@command{sudo} rather than @command{su} to become a different user.
946 1077
947@end itemize 1078@end table
948 1079
949Some people might wish to use port forwarding with @code{ssh} or maybe 1080Some people might wish to use port forwarding with @command{ssh} or
950they have to use a nonstandard port. This can be accomplished by 1081maybe they have to use a nonstandard port. This can be accomplished
951putting a stanza in @file{~/.ssh/config} for the account which specifies 1082by putting a stanza in @file{~/.ssh/config} for the account which
952a different port number for a certain host name. But it can also be 1083specifies a different port number for a certain host name. But it can
953accomplished within Tramp, by adding a multi-hop method. For example: 1084also be accomplished within Tramp, by adding a multi-hop method. For
1085example:
954 1086
955@lisp 1087@lisp
956(add-to-list 'tramp-multi-connection-function-alist 1088(add-to-list 'tramp-multi-connection-function-alist
@@ -963,16 +1095,38 @@ the standard port.
963 1095
964@node Default Method 1096@node Default Method
965@section Selecting a default method 1097@section Selecting a default method
1098@cindex default method
966 1099
1100@vindex tramp-default-method
967When you select an appropriate transfer method for your typical usage 1101When you select an appropriate transfer method for your typical usage
968you should set the variable @var{tramp-default-method} to reflect that 1102you should set the variable @var{tramp-default-method} to reflect that
969choice. This variable controls which method will be used when a method 1103choice. This variable controls which method will be used when a method
970is not specified in the @tramp{} file path. For example: 1104is not specified in the @tramp{} file path. For example:
971 1105
972@lisp 1106@lisp
973(setq tramp-default-method "scp") 1107(setq tramp-default-method "scp")
974@end lisp 1108@end lisp
975 1109
1110@vindex tramp-default-method-alist
1111You can also specify different methods for certain user/host
1112combinations, via the variable @var{tramp-default-method-alist}. For
1113example, the following two lines specify to use the @option{sm}
1114method for all user names matching @samp{john} and the @option{rsync}
1115method for all host names matching @samp{lily}. The third line
1116specifies to use the @option{sum} method for the user @samp{root} on
1117the machine @samp{localhost}.
1118
1119@lisp
1120(add-to-list 'tramp-default-method-alist '("" "john" "sm"))
1121(add-to-list 'tramp-default-method-alist '("lily" "" "rsync"))
1122(add-to-list 'tramp-default-method-alist
1123 '("\\`root\\'" "\\`localhost\\'" "sum"))
1124@end lisp
1125
1126@noindent
1127See the documentation for the variable
1128@var{tramp-default-method-alist} for more details.
1129
976External transfer methods are normally preferable to inline transfer 1130External transfer methods are normally preferable to inline transfer
977methods, giving better performance. They may not be useful if you use 1131methods, giving better performance. They may not be useful if you use
978many remote machines where you cannot log in without a password. 1132many remote machines where you cannot log in without a password.
@@ -998,6 +1152,9 @@ read the content of the files you are editing.
998 1152
999@node Customizing Methods 1153@node Customizing Methods
1000@section Using Non-Standard Methods 1154@section Using Non-Standard Methods
1155@cindex customizing methods
1156@cindex using non-standard methods
1157@cindex create your own methods
1001 1158
1002There is a variable @code{tramp-methods} which you can change if the 1159There is a variable @code{tramp-methods} which you can change if the
1003predefined methods don't seem right. 1160predefined methods don't seem right.
@@ -1022,6 +1179,7 @@ Certain other tools, such as @command{perl} (or @command{perl5}) and
1022available, they are used to improve the performance and accuracy of 1179available, they are used to improve the performance and accuracy of
1023remote file access. 1180remote file access.
1024 1181
1182@vindex tramp-remote-path
1025When @tramp{} connects to the remote machine, it searches for the 1183When @tramp{} connects to the remote machine, it searches for the
1026programs that it can use. The variable @var{tramp-remote-path} controls 1184programs that it can use. The variable @var{tramp-remote-path} controls
1027the directories searched on the remote machine. 1185the directories searched on the remote machine.
@@ -1043,13 +1201,17 @@ as:
1043(require 'tramp) @i{; @tramp{} must be loaded before this} 1201(require 'tramp) @i{; @tramp{} must be loaded before this}
1044 @i{; happens.} 1202 @i{; happens.}
1045 1203
1046@i{; We have @command{perl} in "/usr/local/perl"} 1204@i{; We have @command{perl} in "/usr/local/perl/bin"}
1047(add-to-list 'tramp-remote-path "/usr/local/perl") 1205(add-to-list 'tramp-remote-path "/usr/local/perl/bin")
1048@end example 1206@end example
1049 1207
1050@node Remote shell setup 1208@node Remote shell setup
1051@comment node-name, next, previous, up 1209@comment node-name, next, previous, up
1052@section Remote shell setup hints 1210@section Remote shell setup hints
1211@cindex remote shell setup
1212@cindex .profile file
1213@cindex .login file
1214@cindex shell init files
1053 1215
1054As explained in the @ref{Overview} section, @tramp{} connects to the 1216As explained in the @ref{Overview} section, @tramp{} connects to the
1055remote host and talks to the shell it finds there. Of course, when you 1217remote host and talks to the shell it finds there. Of course, when you
@@ -1079,10 +1241,10 @@ the right way to do this.)
1079Below you find a discussion of a few things that @tramp{} does not deal 1241Below you find a discussion of a few things that @tramp{} does not deal
1080with, and that you therefore have to set up correctly. 1242with, and that you therefore have to set up correctly.
1081 1243
1082@itemize 1244@table @asis
1083@item @code{shell-prompt-pattern} 1245@item @var{shell-prompt-pattern}
1084
1085@vindex shell-prompt-pattern 1246@vindex shell-prompt-pattern
1247
1086After logging in to the remote host, @tramp{} has to wait for the remote 1248After logging in to the remote host, @tramp{} has to wait for the remote
1087shell startup to finish before it can send commands to the remote 1249shell startup to finish before it can send commands to the remote
1088shell. The strategy here is to wait for the shell prompt. In order to 1250shell. The strategy here is to wait for the shell prompt. In order to
@@ -1097,6 +1259,8 @@ recognizes the @code{>} character as the end of the prompt, but it is
1097not at the end of the buffer. 1259not at the end of the buffer.
1098 1260
1099@item @code{tset} and other questions 1261@item @code{tset} and other questions
1262@cindex Unix command tset
1263@cindex tset Unix command
1100 1264
1101Some people invoke the @code{tset} program from their shell startup 1265Some people invoke the @code{tset} program from their shell startup
1102scripts which asks the user about the terminal type of the shell. Maybe 1266scripts which asks the user about the terminal type of the shell. Maybe
@@ -1114,14 +1278,17 @@ connecting.
1114The variable @code{tramp-terminal-type} can be used to change this value 1278The variable @code{tramp-terminal-type} can be used to change this value
1115@code{dumb}. 1279@code{dumb}.
1116 1280
1117@end itemize 1281@end table
1118 1282
1119 1283
1120@node Windows setup hints 1284@node Windows setup hints
1121@section Issues with Cygwin ssh 1285@section Issues with Cygwin ssh
1286@cindex Cygwin
1122 1287
1123This section needs a lot of work! Please help. 1288This section needs a lot of work! Please help.
1124 1289
1290@cindex method smx with Cygwin
1291@cindex smx method with Cygwin
1125If you use the Cygwin installation of ssh (you have to explicitly select 1292If you use the Cygwin installation of ssh (you have to explicitly select
1126it in the installer), then it should work out of the box to just select 1293it in the installer), then it should work out of the box to just select
1127@code{smx} as the connection method. You can find information about 1294@code{smx} as the connection method. You can find information about
@@ -1130,14 +1297,15 @@ setting up Cygwin in their FAQ at @uref{http://cygwin.com/faq/}.
1130 1297
1131@node Usage 1298@node Usage
1132@chapter Using @tramp 1299@chapter Using @tramp
1300@cindex using @tramp
1133 1301
1134Once you have installed @tramp{} it will operate fairly transparently. You 1302Once you have installed @tramp{} it will operate fairly transparently. You
1135will be able to access files on any remote machine that you can log in 1303will be able to access files on any remote machine that you can log in
1136to as though they were local. 1304to as though they were local.
1137 1305
1138Files are specified to @tramp{} using a formalized syntax specifying the 1306Files are specified to @tramp{} using a formalized syntax specifying the
1139details of the system to connect to. This is similar to the syntax used 1307details of the system to connect to. This is similar to the syntax used
1140by the @command{EFS} and @command{ange-ftp} packages. 1308by the @command{EFS} and @command{Ange-FTP} packages.
1141 1309
1142 1310
1143@menu 1311@menu
@@ -1149,6 +1317,8 @@ by the @command{EFS} and @command{ange-ftp} packages.
1149 1317
1150@node Filename Syntax 1318@node Filename Syntax
1151@section @tramp{} filename conventions 1319@section @tramp{} filename conventions
1320@cindex filename syntax
1321@cindex filename examples
1152 1322
1153On Emacs, the Ange-FTP and Tramp filenames use a unified syntax. On 1323On Emacs, the Ange-FTP and Tramp filenames use a unified syntax. On
1154XEmacs, EFS and Tramp use different formats for the filenames. 1324XEmacs, EFS and Tramp use different formats for the filenames.
@@ -1227,6 +1397,8 @@ in my home directory I would specify the filename
1227 1397
1228@node Multi-hop filename syntax 1398@node Multi-hop filename syntax
1229@section Multi-hop filename conventions 1399@section Multi-hop filename conventions
1400@cindex filename syntax for multi-hop files
1401@cindex multi-hop filename syntax
1230 1402
1231The syntax of multi-hop file names is necessarily slightly different 1403The syntax of multi-hop file names is necessarily slightly different
1232than the syntax of other @tramp{} file names. Here's an example multi-hop 1404than the syntax of other @tramp{} file names. Here's an example multi-hop
@@ -1271,6 +1443,8 @@ want to add your own.
1271 1443
1272@node Dired 1444@node Dired
1273@section Dired and filename completion 1445@section Dired and filename completion
1446@cindex dired
1447@cindex filename completion
1274 1448
1275@tramp{} works transparently with dired, enabling you to use this powerful 1449@tramp{} works transparently with dired, enabling you to use this powerful
1276file management tool to manage files on any machine you have access to 1450file management tool to manage files on any machine you have access to
@@ -1281,17 +1455,18 @@ although there is no completion for user names or machine names at this
1281stage. 1455stage.
1282 1456
1283As filename completion needs to fetch the listing of files from the 1457As filename completion needs to fetch the listing of files from the
1284remote machine, this feature is sometimes fairly slow. As @tramp{} does not 1458remote machine, this feature is sometimes fairly slow. As @tramp{} does not
1285yet cache the results of directory listing, there is no gain in 1459yet cache the results of directory listing, there is no gain in
1286performance the second time you complete filenames. 1460performance the second time you complete filenames.
1287 1461
1288If you need to browse a directory tree, Dired is a better choice, at 1462If you need to browse a directory tree, Dired is a better choice, at
1289present, than filename completion. Dired has its own cache mechanism 1463present, than filename completion. Dired has its own cache mechanism
1290and will only fetch the directory listing once. 1464and will only fetch the directory listing once.
1291 1465
1292 1466
1293@node Bug Reports 1467@node Bug Reports
1294@chapter Reporting Bugs and Problems 1468@chapter Reporting Bugs and Problems
1469@cindex bug reports
1295 1470
1296Bugs and problems with @tramp{} are actively worked on by the development 1471Bugs and problems with @tramp{} are actively worked on by the development
1297team. Feature requests and suggestions are also more than welcome. 1472team. Feature requests and suggestions are also more than welcome.
@@ -1322,9 +1497,12 @@ development team to analyze and correct the problem.
1322 1497
1323@node Frequently Asked Questions 1498@node Frequently Asked Questions
1324@chapter Frequently Asked Questions 1499@chapter Frequently Asked Questions
1500@cindex frequently asked questions
1501@cindex FAQ
1325 1502
1326@itemize @bullet 1503@itemize @bullet
1327@item Where can I get the latest @tramp{}? 1504@item
1505Where can I get the latest @tramp{}?
1328 1506
1329@tramp{} is available at 1507@tramp{} is available at
1330@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}. 1508@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}.
@@ -1332,7 +1510,8 @@ There is also a Savannah project page, at
1332@uref{https://savannah.gnu.org/projects/tramp/}. 1510@uref{https://savannah.gnu.org/projects/tramp/}.
1333 1511
1334 1512
1335@item Which systems does it work on? 1513@item
1514Which systems does it work on?
1336 1515
1337The package has been used successfully on Emacs 20 and Emacs 21, as well 1516The package has been used successfully on Emacs 20 and Emacs 21, as well
1338as XEmacs 21. XEmacs 20 is more problematic, see the notes in 1517as XEmacs 21. XEmacs 20 is more problematic, see the notes in
@@ -1356,7 +1535,8 @@ Web page with instructions:
1356Emacs? I think there was some issue with @command{ssh}? 1535Emacs? I think there was some issue with @command{ssh}?
1357 1536
1358 1537
1359@item I can't stop EFS starting with XEmacs 1538@item
1539I can't stop EFS starting with XEmacs
1360 1540
1361Not all the older versions of @tramp{} supported XEmacs correctly. The 1541Not all the older versions of @tramp{} supported XEmacs correctly. The
1362first thing to do is to make sure that you have the latest version of 1542first thing to do is to make sure that you have the latest version of
@@ -1369,7 +1549,8 @@ report would make it easier for the developers to work out what is going
1369wrong. 1549wrong.
1370 1550
1371 1551
1372@item File name completion does not work with @tramp{} 1552@item
1553File name completion does not work with @tramp{}
1373 1554
1374When you log in to the remote machine, do you see the output of 1555When you log in to the remote machine, do you see the output of
1375@command{ls} in color? If so, this may be the cause of your problems. 1556@command{ls} in color? If so, this may be the cause of your problems.
@@ -1387,7 +1568,8 @@ display the output of @command{ls} in color. If you still cannot use
1387filename completion, report a bug to the @tramp{} developers. 1568filename completion, report a bug to the @tramp{} developers.
1388 1569
1389 1570
1390@item File name completion does not work in large directories 1571@item
1572File name completion does not work in large directories
1391 1573
1392@tramp{} uses globbing for some operations. (Globbing means to use the 1574@tramp{} uses globbing for some operations. (Globbing means to use the
1393shell to expand wildcards such as `*.c'.) This might create long 1575shell to expand wildcards such as `*.c'.) This might create long
@@ -1396,20 +1578,22 @@ choke on long command lines, or don't cope well with the globbing
1396itself. 1578itself.
1397 1579
1398If you have a large directory on the remote end, you may wish to execute 1580If you have a large directory on the remote end, you may wish to execute
1399a command like @command{ls -d * ..?* > /dev/null} and see if it hangs. 1581a command like @samp{ls -d * ..?* > /dev/null} and see if it hangs.
1400Note that you must first start the right shell, which might be 1582Note that you must first start the right shell, which might be
1401@command{/bin/sh}, @command{ksh} or @command{bash}, depending on which 1583@command{/bin/sh}, @command{ksh} or @command{bash}, depending on which
1402of those supports tilde expansion. 1584of those supports tilde expansion.
1403 1585
1404 1586
1405@item What kinds of systems does @tramp{} work on 1587@item
1588What kinds of systems does @tramp{} work on
1406 1589
1407@tramp{} really expects the remote system to be a Unix-like system. The 1590@tramp{} really expects the remote system to be a Unix-like system. The
1408local system should preferably be Unix-like, as well, but @tramp{} might 1591local system should preferably be Unix-like, as well, but @tramp{} might
1409work on NT with some tweaking. 1592work on NT with some tweaking.
1410 1593
1411 1594
1412@item How can I get notified when @tramp{} file transfers are complete? 1595@item
1596How can I get notified when @tramp{} file transfers are complete?
1413 1597
1414The following snippet can be put in your @file{~/.emacs} file. It makes 1598The following snippet can be put in your @file{~/.emacs} file. It makes
1415Emacs beep after reading from or writing to the remote host. 1599Emacs beep after reading from or writing to the remote host.
@@ -1433,8 +1617,9 @@ Emacs beep after reading from or writing to the remote host.
1433@end lisp 1617@end lisp
1434 1618
1435 1619
1436@item There's this @file{~/.sh_history} file on the remote host which 1620@item
1437 keeps growing and growing. What's that? 1621There's this @file{~/.sh_history} file on the remote host which keeps
1622growing and growing. What's that?
1438 1623
1439Sometimes, @tramp{} starts @code{ksh} on the remote host for tilde 1624Sometimes, @tramp{} starts @code{ksh} on the remote host for tilde
1440expansion. Maybe @code{ksh} saves the history by default. @tramp{} 1625expansion. Maybe @code{ksh} saves the history by default. @tramp{}
@@ -1460,7 +1645,7 @@ fi
1460@node Version Control 1645@node Version Control
1461@chapter The inner workings of remote version control 1646@chapter The inner workings of remote version control
1462 1647
1463Unlike EFS and ange-ftp, @tramp{} has full shell access to the remote 1648Unlike EFS and Ange-FTP, @tramp{} has full shell access to the remote
1464machine. This makes it possible to provide version control for files 1649machine. This makes it possible to provide version control for files
1465accessed under @tramp{}. 1650accessed under @tramp{}.
1466 1651