aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorKai Großjohann2002-06-17 11:47:23 +0000
committerKai Großjohann2002-06-17 11:47:23 +0000
commitfb7933a38932ce8832a40507e8e10bd61e27eaee (patch)
tree5d089864c0a49b6ad43844ad3879e74d20f42801 /man
parentd591a83451f2a117a2f6bdc95fc0b401c6b69cd0 (diff)
downloademacs-fb7933a38932ce8832a40507e8e10bd61e27eaee.tar.gz
emacs-fb7933a38932ce8832a40507e8e10bd61e27eaee.zip
*** empty log message ***
Diffstat (limited to 'man')
-rw-r--r--man/tramp.texi1626
1 files changed, 1626 insertions, 0 deletions
diff --git a/man/tramp.texi b/man/tramp.texi
new file mode 100644
index 00000000000..5123f6c7ffb
--- /dev/null
+++ b/man/tramp.texi
@@ -0,0 +1,1626 @@
1\input texinfo @c -*-texinfo-*-
2@c %**start of header
3@setfilename tramp.info
4@settitle TRAMP User Manual
5@setchapternewpage odd
6@c %**end of header
7
8@c This is *so* much nicer :)
9@footnotestyle end
10
11@c Version values, for easy modification
12@c NOTE: The 'UPDATED' value is updated by the 'time-stamp' function.
13@c If you change it by hand, the modifications will not stay.
14@set VERSION $Revision: 2.20 $
15@set UPDATED Friday, 14 June, 2002
16
17
18@c Entries for @command{install-info} to use
19@direntry
20* TRAMP: (tramp). Transparent Remote Access, Multiple Protocol
21 Emacs remote file access via rsh and rcp.
22@end direntry
23
24@c Macro to make formatting of the tramp program name consistent.
25@macro tramp
26@sc{tramp}
27@end macro
28
29@c Copying permissions, et al
30@ifinfo
31This file documents @tramp{}, a remote file editing package for Emacs and
32XEmacs.
33
34Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
35
36Permission is granted to make and distribute verbatim copies of this
37manual provided the copyright notice and this permission notice are
38preserved on all copies.
39
40@ignore
41Permission is granted to process this file through TeX and print the
42results, provided the printed document carries a copying permission
43notice identical to this one except for the removal of this paragraph
44(this paragraph not being relevant to the printed manual).
45
46@end ignore
47Permission is granted to copy and distribute modified versions of this
48manual under the conditions for verbatim copying, provided also that the
49sections entitled ``Copying'' and ``GNU General Public License'' are
50included exactly as in the original, and provided that the entire
51resulting derived work is distributed under the terms of a permission
52notice identical to this one.
53
54Permission is granted to copy and distribute translations of this manual
55into another language, under the above conditions for modified versions,
56except that this permission notice may be stated in a translation
57approved by the Free Software Foundation.
58@end ifinfo
59
60@tex
61
62@titlepage
63@title @tramp{} User Manual
64@subtitle Last updated @value{UPDATED}
65
66@author by Daniel Pittman
67@author based on documentation by Kai Gro@ss{}johann
68@page
69
70@vskip 0pt plus 1filll
71Permission is granted to make and distribute verbatim copies of this
72manual provided the copyright notice and this permission notice are
73preserved on all copies.
74
75Permission is granted to copy and distribute modified versions of this
76manual under the conditions for verbatim copying, provided also that the
77sections entitled ``Copying'' and ``GNU General Public License'' are
78included exactly as in the original, and provided that the entire
79resulting derived work is distributed under the terms of a permission
80notice identical to this one.
81
82Permission is granted to copy and distribute translations of this manual
83into another language, under the above conditions for modified versions,
84except that this permission notice may be stated in a translation
85approved by the Free Software Foundation.
86
87@end titlepage
88@page
89
90@end tex
91
92@ifnottex
93@node Top, Copying, (dir), (dir)
94@top @tramp{} User Manual
95
96@tramp{} stands for `Transparent Remote (file) Access, Multiple
97Protocol'. This package provides remote file editing, similar to
98@cite{ange-ftp} and @cite{EFS}.
99
100The difference is that ange-ftp uses FTP to transfer files between the
101local and the remote host, whereas @tramp{} uses a combination of
102@command{rsh} and @command{rcp} or other work-alike programs, such as
103@command{ssh}/@command{scp}.
104
105This is version @value{VERSION} of the @tramp{} manual, last updated on
106@value{UPDATED}.
107
108You can find the latest version of this document on the web at
109@uref{http://www.freesoftware.fsf.org/tramp/}.
110
111@ifhtml
112This manual is also available as a @uref{tramp_ja.html, Japanese
113translation}.
114
115The latest release of @tramp{} is available for
116@uref{http://savannah.gnu.org/download/tramp/,
117download}, or you may see @ref{Obtaining @tramp{}} for more details,
118including the CVS server details.
119
120@tramp{} also has a @uref{https://savannah.gnu.org/projects/tramp/,
121Savannah Project Page}.
122@end ifhtml
123
124There is a mailing list for @tramp{}, available at
125@email{tramp-devel@@mail.freesoftware.fsf.org}, and archived at
126@uref{http://www.mail-archive.com/emacs-rcp@@ls6.cs.uni-dortmund.de/} as
127well as the usual Savannah archives.
128
129@end ifnottex
130
131@menu
132* Copying:: @tramp{} Copying conditions.
133* Overview:: What @tramp{} can and cannot do.
134
135For the end user:
136* Obtaining @tramp{}:: How to obtain @tramp{}.
137* History:: History of @tramp{}
138* Installation:: Installing @tramp{} with your (X)Emacs.
139* Configuration:: Configuring @tramp{} for use.
140* Usage:: An overview of the operation of @tramp{}.
141* Bug Reports:: Reporting Bugs and Problems
142* Frequently Asked Questions:: Questions and answers from the mailing list.
143
144For the developer:
145* Version Control:: The inner workings of remote version control.
146* Files directories and paths:: How file names, directories and paths are mangled and managed.
147* Issues::
148
149@detailmenu
150 --- The Detailed Node Listing ---
151
152Configuring @tramp{} for use
153
154* Connection types:: Types of connections made to remote machines.
155* Inline methods:: Inline methods.
156* External transfer methods:: External transfer methods.
157* Multi-hop Methods:: Connecting to a remote host using multiple hops.
158* Default Method:: Selecting a default method.
159* Customizing Methods:: Using Non-Standard Methods.
160* Remote Programs:: How @tramp{} finds and uses programs on the remote machine.
161* Remote shell setup::
162
163Using @tramp
164
165* Filename Syntax:: @tramp{} filename conventions.
166* Multi-hop filename syntax:: Multi-hop filename conventions
167* Dired:: Dired and filename completion.
168
169The inner workings of remote version control
170
171* Version Controlled Files:: Determining if a file is under version control.
172* Remote Commands:: Executing the version control commands on the remote machine.
173* Changed workfiles:: Detecting if the working file has changed.
174* Checking out files:: Bringing the workfile out of the repository.
175* Miscellaneous Version Control:: Things related to Version Control that don't fit elsewhere
176
177Things related to Version Control that don't fit elsewhere
178
179* Remote File Ownership:: How VC determines who owns a workfile.
180* Back-end Versions:: How VC determines what release your RCS is.
181
182How file names, directories and paths are mangled and managed.
183
184* Path deconstruction:: Breaking a path into its components.
185
186@end detailmenu
187@end menu
188
189@node Copying
190@chapter @tramp{} Copying conditions
191
192Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
193
194tramp.el is free software; you can redistribute it and/or modify it under
195the terms of the GNU General Public License as published by the Free
196Software Foundation; either version 2, or (at your option) any later
197version.
198
199tramp.el is distributed in the hope that it will be useful, but WITHOUT
200ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
201FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
202more details.
203
204You should have received a copy of the GNU General Public License along
205with GNU Emacs; see the file COPYING. If not, write to the Free Software
206Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
207USA.
208
209
210@node Overview
211@chapter An overview of @tramp
212
213After the installation of @tramp{} into your Emacs, you will be able to
214access files on remote machines as though they were local. Access to the
215remote file system for editing files, version control, and
216@command{dired} are transparently enabled.
217
218Your access to the remote machine can be with the @command{rsh},
219@command{rlogin}, @command{telnet} programs or with any similar
220connection method. This connection must pass ASCII successfully to be
221usable but need not be 8-bit clean.
222
223The package provides support for @command{ssh} connections out of the
224box, one of the more common uses of the package. This allows relatively
225secure access to machines, especially if @command{ftp} access is
226disabled.
227
228The majority of activity carried out by @tramp{} requires only that the
229remote login is possible and is carried out at the terminal. In order to
230access remote files @tramp{} needs to transfer their content to the local
231machine temporarily.
232
233@tramp{} can transfer files between the machines in a variety of ways. The
234details are easy to select, depending on your needs and the machines in
235question.
236
237The fastest transfer methods rely on a remote file transfer package such
238as @command{rcp}, @command{scp} or @command{rsync}. The use of these
239methods is only possible if the file copy command does not ask for a
240password for the remote machine.
241
242If the remote copy methods are not suitable for you, @tramp{} also
243supports the use of encoded transfers directly through the shell. This
244requires that the @command{mimencode} or @command{uuencode} tools are
245available on the remote machine.
246
247Within these limitations, @tramp{} is quite powerful. It is worth noting
248that, as of the time of writing, it is far from a polished end-user
249product. For a while yet you should expect to run into rough edges and
250problems with the code now and then.
251
252It is finished enough that the developers use it for day to day work but
253the installation and setup can be a little difficult to master, as can
254the terminology.
255
256@tramp{} is still under active development and any problems you encounter,
257trivial or major, should be reported to the @tramp{} developers.
258@xref{Bug Reports}.
259
260
261@subsubheading Behind the scenes
262
263This section tries to explain what goes on behind the scenes when you
264access a remote file through @tramp{}.
265
266Suppose you type @kbd{C-x C-f} and enter part of an @tramp{} file name,
267then hit @kbd{@key{TAB}} for completion. Suppose further that this is
268the first time that @tramp{} is invoked for the host in question. Here's
269what happens:
270
271@itemize
272@item
273@tramp{} discovers that it needs a connection to the host. So it invokes
274@command{telnet HOST} or @command{rsh HOST -l USER} or a similar tool to
275connect to the remote host. Communication with this process happens
276through an Emacs buffer, that is, the output from the remote end goes
277into a buffer.
278
279@item
280The remote host may prompt for a login name (for @command{telnet}). The
281login name is given in the file name, so @tramp{} sends the login name and
282a newline.
283
284@item
285The remote host may prompt for a password or pass phrase (for
286@command{rsh} or for @command{telnet} after sending the login name).
287@tramp{} displays the prompt in the minibuffer, asking you for the
288password or pass phrase.
289
290You enter the password or pass phrase. @tramp{} sends it to the remote
291host, followed by a newline.
292
293@item
294@tramp{} now waits for the shell prompt or for a message that the login
295failed.
296
297If @tramp{} sees neither of them after a certain period of time (a minute,
298say), then it issues an error message saying that it couldn't find the
299remote shell prompt and shows you what the remote host has sent.
300
301If @tramp{} sees a `login failed' message, it tells you so, aborts the
302login attempt and allows you to try again.
303
304@item
305Suppose that the login was successful and @tramp{} sees the shell prompt
306from the remote host. Now @tramp{} invokes @command{/bin/sh} because
307Bourne shells and C shells have different command
308syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login
309shell doesn't recognize @command{exec /bin/sh} as a valid command.
310Maybe you use the Scheme shell @command{scsh}@dots{}}
311
312After the Bourne shell has come up, @tramp{} sends a few commands to
313ensure a good working environment. It turns off echoing, it sets the
314shell prompt, and a few other things.
315
316@item
317Now the remote shell is up and it good working order. Remember, what
318was supposed to happen is that @tramp{} tries to find out what files exist
319on the remote host so that it can do filename completion.
320
321So, @tramp{} basically issues @command{cd} and @command{ls} commands and
322also sometimes @command{echo} with globbing. Another command that is
323often used is @command{test} to find out whether a file is writable or a
324directory or the like. The output of each command is parsed for the
325necessary operation.
326
327@item
328Suppose you are finished with filename completion, have entered @kbd{C-x
329C-f}, a full file name and hit @kbd{@key{RET}}. Now comes the time to
330transfer the file contents from the remote host to the local host so
331that you can edit them.
332
333See above for an explanation of how @tramp{} transfers the file contents.
334
335For inline transfers, @tramp{} issues a command like @command{mimencode -b
336/path/to/remote/file}, waits until the output has accumulated in the
337buffer that's used for communication, then decodes that output to
338produce the file contents.
339
340For out-of-band transfers, @tramp{} issues a command like @command{rcp
341user@@host:/path/to/remote/file /tmp/tramp.4711} and then reads the local
342temporary file @file{/tmp/tramp.4711} into a buffer and deletes the
343temporary file.
344
345@item
346You now edit the buffer contents, blithely unaware of what has happened
347behind the scenes. (Unless you have read this section, that is.) When
348you are finished, you type @kbd{C-x C-s} to save the buffer.
349
350@item
351Again, @tramp{} transfers the file contents to the remote host either
352inline or out-of-band. This is the reverse of what happens when reading
353the file.
354
355@end itemize
356
357I hope this has provided you with a basic overview of what happens
358behind the scenes when you open a file with @tramp{}.
359
360
361@c For the end user
362@node Obtaining @tramp{}
363@chapter Obtaining @tramp{}.
364
365@tramp{} is freely available on the Internet and the latest release may be
366downloaded from
367@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}. This
368release includes the full documentation and code for @tramp{}, suitable
369for installation.
370
371For the especially brave, @tramp{} is available from CVS. The CVS version
372is the latest version of the code and may contain incomplete features or
373new issues. Use these versions at your own risk.
374
375Instructions for obtaining the latest development version of @tramp{}
376from CVS can be found by going to the Savannah project page at
377@uref{http://savannah.gnu.org/projects/tramp/} and then clicking on the
378CVS link in the navigation bar at the top. Or follow the example
379session below:
380
381@example
382] @strong{cd ~/lisp}
383] @strong{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/tramp login}
384
385(Logging in to anoncvs@@subversions.gnu.org)
386CVS password: @strong{(just hit RET here)}
387@dots{}
388
389] @strong{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/tramp co tramp}
390@end example
391
392You should now have a directory @file{~/lisp/tramp} containing the latest
393version of @tramp{}. You can fetch the latest updates from the repository
394by issuing the command:
395
396@example
397] @strong{cd ~/lisp/tramp}
398] @strong{cvs update -d}
399@end example
400
401
402@node History
403@chapter History of @tramp{}
404
405Development was started end of November 1998. The package was called
406`rssh.el', back then. It only provided one method to access a file,
407using @command{ssh} to log in to a remote host and using @command{scp}
408to transfer the file contents. After a while, the name was changed to
409`rcp.el', and now it's @tramp{}. Along the way, many more methods for
410getting a remote shell and for transferring the file contents were
411added. Support for VC was added.
412
413The most recent addition of a major feature was the multi-hop methods
414added in April 2000.
415
416
417@node Installation
418@chapter Installing @tramp{} into Emacs or XEmacs
419
420Installing @tramp{} into your Emacs or XEmacs is a relatively easy
421process, at least compared to rebuilding your machine from scratch. ;)
422
423Seriously though, the installation should be a fairly simple matter.
424
425The easiest way to proceed is as follows:
426
427@itemize
428@item
429Choose a directory, say @file{~/emacs/}. Change into that directory and
430unpack the tarball. This will give you a directory
431@file{~/emacs/tramp/} which contains subdirectories @file{lisp} for the
432Lisp code and @file{texi} for the documentation.
433
434@item
435Optionally byte-compile all files in the Lisp directory,
436@file{~/emacs/tramp/lisp/}, by issuing a command like the following from
437the top level directory @file{~/emacs/tramp/}:
438@example
439make EMACS=emacs all # for Emacs users
440make EMACS=xemacs all # for XEmacs users
441@end example
442
443@item
444NOTE:
445@example
446If you run into problems running the example @command{make}
447commands, don't dispare. You can still byte compile the
448@file{*.el} files by opening emacs in @command{dired}
449(@command{C-x d}) mode, at @file{~/tramp/lisp}. Mark the lisp
450files with @command{m}, then press @command{B} to byte compile
451your selections.
452
453Something similar can be done to create the info manual.
454Just cd to @file{~/emacs/tramp/texi} and load the @file{tramp.texi}
455file in emacs. Then press @command{M-x makeinfo-buffer <RET>}
456to generate @file{tramp.info}.
457@end example
458
459@item
460Tell Emacs about the new Lisp directory and the @tramp{} package
461with the following lines in @file{~/.emacs}:
462@lisp
463(add-to-list 'load-path "~/emacs/tramp/lisp/")
464(require 'tramp)
465@end lisp
466
467@item
468To be able to read the Info documentation, create a file
469@file{~/emacs/tramp/texi/dir} using for example the
470@command{install-info} command, and add the directory to the search
471path for Info.
472
473@item
474NOTE:
475@example
476On systems using `gnu' @command{install-info}, the
477@command{install-info} syntax is very direct and simple. One can
478cd to @file{~/emacs/tramp/texi} and type:
479 @command{install-info tramp.info dir}
480and a @file{dir} file will be created with the @tramp{}
481entry. The info reader will know how to interpret it, but must
482be told where to find it (see below). If you want anything fancier
483you'll need to look through @command{man install-info}.
484
485Debian gnu/linux doesn't default to `gnu' @command{install-info} and
486uses its own version. This version does not create a @file{dir} file
487for you from scratch. You must provide a skeleton dir file it
488recognizes. One can be found in a default install at
489@file{/usr/info/dir}. Copy the top of this file down to the first
490occurrence of `* Menu' including that line plus one more blank line,
491to your working directory @file{texi/dir}, or use the sample provided
492in the @file{texi} directroy of this distribution. See
493@file{texi/dir_sample}
494
495Once a @file{dir} file is in place, this command will make the entry.
496 install-info --infodir=. tramp.info
497If you want it in a specific category
498 (see @command{man install-info} for further details)
499@end example
500
501If the environment variable @env{INFOPATH} is set, add the directory
502@file{~/emacs/tramp/texi/} to it. Else, add the directory to
503@code{Info-default-directory-list}, as follows:
504@lisp
505(add-to-list 'Info-default-directory-list "~/emacs/tramp/texi/")
506@end lisp
507XEmacs 21 users should use @code{Info-directory-list} rather than
508@code{Info-default-directory-list}.
509
510@end itemize
511
512
513For XEmacs users, the package @command{fsf-compat} must be installed.
514For details on package installation, see @ref{Packages, , ,xemacs}.
515@ifhtml
516(If the previous link doesn't work, try the XEmacs documentation at
517@uref{http://www.xemacs.org/Documentation/packageGuide.html,the XEmacs
518site}.)
519@end ifhtml
520
521@node Configuration
522@chapter Configuring @tramp{} for use
523
524@tramp{} is (normally) fully functional when it is initially
525installed. It is initially configured to use the @command{rsh} and
526@command{rcp} programs to connect to the remote host.
527
528On some hosts, there are problems with opening a connection. These are
529related to the behavior of the remote shell. See @xref{Remote shell
530setup}, for details on this.
531
532If you do not wish to use these commands to connect to the remote host,
533you should change the default connection and transfer method that @tramp
534uses. There are several different methods that @tramp{} can use to
535connect to remote machines and transfer files (@pxref{Connection types}).
536
537
538@menu
539* Connection types:: Types of connections made to remote machines.
540* Inline methods:: Inline methods.
541* External transfer methods:: External transfer methods.
542* Multi-hop Methods:: Connecting to a remote host using multiple hops.
543* Default Method:: Selecting a default method.
544* Customizing Methods:: Using Non-Standard Methods.
545* Remote Programs:: How @tramp{} finds and uses programs on the remote machine.
546* Remote shell setup:: Remote shell setup hints.
547* Windows setup hints:: Issues with Cygwin ssh.
548@end menu
549
550
551@node Connection types
552@section Types of connections made to remote machines.
553
554There are two basic types of transfer methods, each with its own
555advantages and limitations. Both types of connection make use of a
556remote shell access program such as @command{rsh}, @command{ssh} or
557@command{telnet} to connect to the remote machine.
558
559This connection is used to perform many of the operations that @tramp
560requires to make the remote file system transparently accessible from
561the local machine. It is only when visiting files that the methods
562differ.
563
564Loading or saving a remote file requires that the content of the file be
565transfered between the two machines. The content of the file can be
566transfered over the same connection used to log in to the remote machine
567or the file can be transfered through another connection using a remote
568copy program such as @command{rcp}, @command{scp} or @command{rsync}.
569The former are called @dfn{inline methods}, the latter are called
570@dfn{external transfer methods}.
571
572The performance of the external transfer methods is generally better
573than that of the inline methods. This is caused by the need to encode
574and decode the data when transferring inline.
575
576The one exception to this rule are the @command{scp} based transfer
577methods. While these methods do see better performance when actually
578transferring files, the overhead of the cryptographic negotiation at
579startup may drown out the improvement in file transfer times.
580
581External transfer methods do require that the remote copy command is not
582interactive --- that is, the command does not prompt you for a password.
583If you cannot perform remote copies without a password, you will need to
584use an inline transfer method to work with @tramp{}.
585
586A variant of the inline methods are the @dfn{multi-hop methods}.
587These methods allow you to connect a remote host using a number `hops',
588each of which connects to a different host. This is useful if you are
589in a secured network where you need to go through a bastion host to
590connect to the outside world.
591
592
593@node Inline methods
594@section Inline methods
595
596The inline methods in @tramp{} are quite powerful and can work in
597situations where you cannot use an external transfer program to connect.
598Inline methods are the only methods that work when connecting to the
599remote machine via telnet. (There are also strange inline methods which
600allow you to transfer files between @emph{user identities} rather than
601hosts, see below.)
602
603These methods depend on the existence of a suitable encoding and
604decoding command on remote machine. Locally, @tramp{} may be able to use
605features of Emacs to decode and encode the files or it may require
606access to external commands to perform that task.
607
608@tramp{} supports the use of @command{uuencode} to transfer files. This is
609@emph{not} recommended. The @command{uuencode} and @command{uudecode}
610commands are not well standardized and may not function correctly or at
611all on some machines, notably AIX and IRIX. These systems do not work
612with @command{uuencode} at all. (But do see the note about AIX in the
613documentation for @var{tramp-methods}.)
614
615In summary, if possible use the @command{mimencode} methods to transfer
616the data base64 encoded. This has the advantage of using a built-in
617command in every modern Emacs, improving performance.
618
619@itemize
620@item @option{rm} --- @command{rsh} with @command{mimencode}
621
622Connect to the remote host with @command{rsh} and use base64 encoding to
623transfer files between the machines.
624
625This requires the @command{mimencode} command that is part of the
626@command{metamail} packages. This may not be installed on all remote
627machines.
628
629
630@item @option{sm} --- @command{ssh} with @command{mimencode}
631
632Connect to the remote host with @command{ssh} and use base64 encoding to
633transfer files between the machines.
634
635This is identical to the previous option except that the @command{ssh}
636package is used, making the connection more secure.
637
638There are also two variants, @option{sm1} and @option{sm2} that use the
639@command{ssh1} and @command{ssh2} commands explicitly. If you don't know
640what these are, you do not need these options.
641
642
643@item @option{tm} --- @command{telnet} with @command{mimencode}
644
645Connect to the remote host with @command{telnet} and use base64 encoding
646to transfer files between the machines.
647
648This requires the @command{mimencode} command that is part of the
649@command{metamail} packages.
650
651
652@item @option{ru} --- @command{rsh} with @command{uuencode}
653
654Connect to the remote host with @command{rsh} and use the
655@command{uuencode} and @command{uudecode} commands to transfer files
656between the machines.
657
658
659@item @option{su} --- @command{ssh} with @command{uuencode}
660
661Connect to the remote host with @command{ssh} and use the
662@command{uuencode} and @command{uudecode} commands to transfer files
663between the machines.
664
665As with the @command{ssh} and base64 option above, this provides the
666@option{su1} and @option{su2} methods to explicitly select an ssh
667version.
668
669Note that this method does not invoke the @command{su} program, see
670below for methods which use that.
671
672
673@item @option{tu} --- @command{telnet} with @command{uuencode}
674
675Connect to the remote host with @command{telnet} and use the
676@command{uuencode} and @command{uudecode} commands to transfer files
677between the machines.
678
679
680@item @option{sum} --- @command{su} with @command{mimencode}
681
682This method does not connect to a remote host at all, rather it uses the
683@command{su} program to allow you to edit files as another user. Uses
684base64 encoding to transfer the file contents.
685
686
687@item @option{suu} --- @command{su} with @command{uuencode}
688
689Like @option{sum}, this uses the @command{su} program to allow you to
690edit files on the local host as another user. Uses @command{uuencode}
691and @command{uudecode} to transfer the file contents.
692
693
694@item @option{sudm} --- @command{sudo} with @command{mimencode}
695
696This is similar to the @option{sum} method, but it uses @command{sudo}
697rather than @command{su} to become a different user.
698
699Note that @command{sudo} must be configured to allow you to start a
700shell as the user. It would be nice if it was sufficient if
701@command{ls} and @command{mimencode} were allowed, but that is not easy
702to implement, so I haven't got around to it, yet.
703
704
705@item @option{sudu} --- @command{sudo} with @command{uuencode}
706
707This is similar to the @option{suu} method, but it uses @command{sudo}
708rather than @command{su} to become a different user.
709
710
711@item @option{smx} --- @command{ssh} with @command{mimencode}
712
713As you expect, this is similar to @option{sm}, only a little
714different. Whereas @option{sm} opens a normal interactive shell on
715the remote host, this option uses @command{ssh -t -t HOST -l USER
716/bin/sh} tp open a connection. This is useful for users where the
717normal login shell is set up to ask them a number of questions when
718logging in. This procedure avoids these questions, and just gives
719@tramp{} a more-or-less `standard' login shell to work with.
720
721This is also useful for Windows users where @command{ssh}, when
722invoked from an Emacs buffer, tells them that it is not allocating a
723pseudo tty. When this happens, the login shell is wont to not print
724any shell prompt, which confuses @tramp{} mightily.
725
726
727@item @option{km} --- @command{krlogin} with @command{mimencode}
728
729This method is also similar to @option{sm}. It only uses the
730@command{krlogin -x} command to log in to the remote host.
731
732
733@item @option{plinku} --- @command{plink} with @command{uuencode}
734
735This method is mostly interesting for Windows users using the PuTTY
736implementation of SSH. It uses @command{plink -ssh} to log in to the
737remote host.
738
739CCC: Do we have to connect to the remote host once from the command
740line to accept the SSH key? Maybe this can be made automatic?
741
742@item @option{plinkm} --- @command{plink} with @command{mimencode}
743
744Like @option{plinku}, but uses base64 encoding instead of uu encoding.
745
746@end itemize
747
748
749
750@node External transfer methods
751@section External transfer methods
752
753The external transfer methods operate through multiple channels, using
754the remote shell connection for many actions while delegating file
755transfers to an external transfer utility.
756
757This saves the overhead of encoding and decoding that multiplexing the
758transfer through the one connection has with the inline methods.
759
760If you want to use an external transfer method you @emph{must} be able
761to execute the transfer utility to copy files to and from the remote
762machine without any interaction.
763
764This means that you will need to use @command{ssh-agent} if you use the
765@command{scp} program for transfers, or maybe your version of
766@command{scp} accepts a password on the command line.@footnote{PuTTY's
767@command{pscp} allows you to specify the password on the command line.}
768If you use @command{rsync} via @command{ssh} then the same rule must
769apply to that connection.
770
771If you cannot get @command{scp} to run without asking for a password but
772would still like to use @command{ssh} to secure your connection, have a
773look at the @command{ssh} based inline methods.
774
775
776@itemize
777@item @option{rcp} --- @command{rsh} and @command{rcp}
778
779This method uses the @command{rsh} and @command{rcp} commands to connect
780to the remote machine and transfer files. This is probably the fastest
781connection method available.
782
783
784@item @option{scp} --- @command{ssh} and @command{scp}
785
786Using @command{ssh} to connect to the remote host and @command{scp} to
787transfer files between the machines is the best method for securely
788connecting to a remote machine and accessing files.
789
790The performance of this option is also quite good. It may be slower than
791the inline methods when you often open and close small files however.
792The cost of the cryptographic handshake at the start of an @command{scp}
793session can begin to absorb the advantage that the lack of encoding and
794decoding presents.
795
796
797@item @option{rsync} --- @command{ssh} and @command{rsync}
798
799Using the @command{ssh} command to connect securely to the remote
800machine and the @command{rsync} command to transfer files is almost
801identical to the @option{scp} method.
802
803While @command{rsync} performs much better than @command{scp} when
804transferring files that exist on both hosts, this advantage is lost if
805the file exists only on one side of the connection.
806
807The @command{rsync} based method may be considerably faster than the
808@command{rcp} based methods when writing to the remote system. Reading
809files to the local machine is no faster than with a direct copy.
810
811
812@item @option{scpx} --- @command{ssh} and @command{scp}
813
814As you expect, this is similar to @option{scp}, only a little
815different. Whereas @option{scp} opens a normal interactive shell on the
816remote host, this option uses @command{ssh -t -t HOST -l USER /bin/sh} to
817open a connection. This is useful for users where the normal login
818shell is set up to ask them a number of questions when logging in. This
819procedure avoids these questions, and just gives @tramp{} a more-or-less
820`standard' login shell to work with.
821
822This is also useful for Windows users where @command{ssh}, when
823invoked from an Emacs buffer, tells them that it is not allocating a
824pseudo tty. When this happens, the login shell is wont to not print
825any shell prompt, which confuses @tramp{} mightily.
826
827
828@item @option{pscp} --- @command{plink} and @command{pscp}
829
830This method is similar to @option{scp}, but it uses the
831@command{plink} command to connect to the remote host, and it uses
832@command{pscp} for transferring the files. These programs are part
833of PuTTY, an SSH implementation for Windows.
834
835
836@item @option{fcp} --- @command{fsh} and @command{fcp}
837
838This method is similar to @option{scp}, but it uses the @command{fsh}
839command to connect to the remote host, and it uses @command{fcp} for
840transferring the files. @command{fsh/fcp} are a front-end for
841@command{ssh} which allow for reusing the same @command{ssh} session
842for submitting several commands. This avoids the startup overhead of
843@command{scp} (which has to establish a secure connection whenever it
844is called). Note, however, that you can also use one of the inline
845methods to achieve a similar effect.
846
847This method uses the command @command{fsh HOST -l USER /bin/sh -i} to
848establish the connection, it does not work to just say @command{fsh
849HOST -l USER}.
850
851@end itemize
852
853@node Multi-hop Methods
854@section Connecting to a remote host using multiple hops
855
856Sometimes, the methods described before are not sufficient. Sometimes,
857it is not possible to connect to a remote host using a simple command.
858For example, if you are in a secured network, you might have to log in
859to a `bastion host' first before you can connect to the outside world.
860Of course, the target host may also require a bastion host. The format
861of multi-hop filenames is slightly different than the format of normal
862@tramp{} methods.
863
864A multi-hop file name specifies a method, a number of hops, and a path
865name on the remote system. The method specifies how the file is
866transferred through the inline connection. The following two multi-hop
867methods are available:
868
869@itemize
870@item @option{multi} --- base64 encoding with @command{mimencode}
871
872The file is transferred through the connection in base64 encoding. Uses
873the @command{mimencode} program for doing encoding and decoding, but
874uses an Emacs internal implementation on the local host if available.
875
876@item @option{multiu} --- use commands @command{uuencode} and @command{uudecode}
877
878The file is transferred through the connection in `uu' encoding. Uses
879the @command{uuencode} and @command{uudecode} programs for encoding and
880decoding, but uses a Lisp implementation for decoding on the local host
881if available.
882
883@end itemize
884
885Each hop consists of a @dfn{hop method} specification, a user name and a
886host name. The following hop methods are (currently) available:
887
888@itemize
889@item @option{telnet}
890
891Uses the well-known @command{telnet} program to connect to the host.
892Whereas user name and host name are supplied in the file name, the
893user is queried for the password.
894
895@item @option{rsh}
896
897This uses @command{rsh} to connect to the host. You do not need to
898enter a password unless @command{rsh} explicitly asks for it.
899
900@item @option{ssh}
901
902This uses @command{ssh} to connect to the host. You might have to enter
903a password or a pass phrase.
904
905@item @option{su}
906
907This method does not actually contact a different host, but it allows
908you to become a different user on the host you're currently on. This
909might be useful if you want to edit files as root, but the remote host
910does not allow remote root logins. In this case you can use
911@option{telnet}, @option{rsh} or @option{ssh} to connect to the
912remote host as a non-root user, then use an @option{su} hop to become
913root. But @option{su} need not be the last hop in a sequence, you could
914also use it somewhere in the middle, if the need arises.
915
916Even though you @emph{must} specify both user and host with a
917@option{su} hop, the host name is ignored and only the user name is
918used.
919
920@item @option{sudo}
921
922This is similar to the @option{su} hop, except that it uses
923@command{sudo} rather than @command{su} to become a different user.
924
925@end itemize
926
927Some people might wish to use port forwarding with @code{ssh} or maybe
928they have to use a nonstandard port. This can be accomplished by
929putting a stanza in @file{~/.ssh/config} for the account which specifies
930a different port number for a certain host name. But it can also be
931accomplished within Tramp, by adding a multi-hop method. For example:
932
933@lisp
934(add-to-list 'tramp-multi-connection-function-alist
935 '("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n"))
936@end lisp
937
938Now you can use a @code{sshf} hop which connects to port 4400 instead of
939the standard port.
940
941
942@node Default Method
943@section Selecting a default method
944
945When you select an appropriate transfer method for your typical usage
946you should set the variable @var{tramp-default-method} to reflect that
947choice. This variable controls which method will be used when a method
948is not specified in the @tramp{} file path. For example:
949
950@lisp
951(setq tramp-default-method "scp")
952@end lisp
953
954External transfer methods are normally preferable to inline transfer
955methods, giving better performance. They may not be useful if you use
956many remote machines where you cannot log in without a password.
957
958@xref{Inline methods}.
959@xref{External transfer methods}.
960@xref{Multi-hop Methods}.
961
962Another consideration with the selection of transfer methods is the
963environment you will use them in and, especially when used over the
964Internet, the security implications of your preferred method.
965
966The @command{rsh} and @command{telnet} methods send your password as
967plain text as you log in to the remote machine, as well as transferring
968the files in such a way that the content can easily be read from other
969machines.
970
971If you need to connect to remote systems that are accessible from the
972Internet, you should give serious thought to using @command{ssh} based
973methods to connect. These provide a much higher level of security,
974making it a non-trivial exercise for someone to obtain your password or
975read the content of the files you are editing.
976
977@node Customizing Methods
978@section Using Non-Standard Methods
979
980There is a variable @code{tramp-methods} which you can change if the
981predefined methods don't seem right.
982
983For the time being, I'll refer you to the Lisp documentation of that
984variable, accessible with @kbd{C-h v tramp-methods @key{RET}}.
985
986
987@node Remote Programs
988@section How @tramp{} finds and uses programs on the remote machine.
989
990@tramp{} depends on a number of programs on the remote host in order to
991function, including @command{ls}, @command{test}, @command{find} and
992@command{cat}.
993
994In addition to these required tools, there are various tools that may be
995required based on the connection method. See @ref{Inline methods} and
996@ref{External transfer methods} for details on these.
997
998Certain other tools, such as @command{perl} (or @command{perl5}) and
999@command{grep} will be used if they can be found. When they are
1000available, they are used to improve the performance and accuracy of
1001remote file access.
1002
1003When @tramp{} connects to the remote machine, it searches for the
1004programs that it can use. The variable @var{tramp-remote-path} controls
1005the directories searched on the remote machine.
1006
1007By default, this is set to a reasonable set of defaults for most
1008machines. It is possible, however, that your local (or remote ;) system
1009administrator has put the tools you want in some obscure local
1010directory.
1011
1012In this case, you can still use them with @tramp{}. You simply need to
1013add code to your @file{.emacs} to add the directory to the remote path.
1014This will then be searched by @tramp{} when you connect and the software
1015found.
1016
1017To add a directory to the remote search path, you could use code such
1018as:
1019
1020@example
1021(require 'tramp) @i{; @tramp{} must be loaded before this}
1022 @i{; happens.}
1023
1024@i{; We have @command{perl} in "/usr/local/perl"}
1025(add-to-list 'tramp-remote-path "/usr/local/perl")
1026@end example
1027
1028@node Remote shell setup
1029@comment node-name, next, previous, up
1030@section Remote shell setup hints
1031
1032As explained in the @ref{Overview} section, @tramp{} connects to the
1033remote host and talks to the shell it finds there. Of course, when you
1034log in, the shell executes its init files. Suppose your init file
1035requires you to enter the birthdate of your mother; clearly @tramp{}
1036does not know this and hence fails to log you in to that host.
1037
1038There are different possible strategies for pursuing this problem. One
1039strategy is to enable @tramp{} to deal with all possible situations.
1040This is a losing battle, since it is not possible to deal with
1041@emph{all} situations. The other strategy is to require you to set up
1042the remote host such that it behaves like @tramp{} expect. This might
1043be inconvenient because you have to invest a lot of effort into shell
1044setup before you can begin to use @tramp{}.
1045
1046The package, therefore, pursues a combined approach. It tries to figure
1047out some of the more common setups, and only requires you to avoid
1048really exotic stuff. For example, it looks through a list of
1049directories to find some programs on the remote host. And also, it
1050knows that it is not obvious how to check whether a file exist, and
1051therefore it tries different possibilities. (On some hosts and shells,
1052the command @code{test -e} does the trick, on some hosts the shell
1053builtin doesn't work but the program @code{/usr/bin/test -e} or
1054@code{/bin/test -e} works. And on still other hosts, @code{ls -d} is
1055the right way to do this.)
1056
1057Below you find a discussion of a few things that @tramp{} does not deal
1058with, and that you therefore have to set up correctly.
1059
1060@itemize
1061@item @code{shell-prompt-pattern}
1062
1063@vindex shell-prompt-pattern
1064After logging in to the remote host, @tramp{} has to wait for the remote
1065shell startup to finish before it can send commands to the remote
1066shell. The strategy here is to wait for the shell prompt. In order to
1067recognize the shell prompt, the variable @code{shell-prompt-pattern} has
1068to be set correctly to recognize the shell prompt on the remote host.
1069
1070@item @code{tset} and other questions
1071
1072Some people invoke the @code{tset} program from their shell startup
1073scripts which asks the user about the terminal type of the shell. Maybe
1074some shells ask other questions when they are started. @tramp{} does
1075not know how to answer these questions. (A facility for enabling
1076@tramp{} to answer these questions is planned for some future version,
1077but don't hold your breath.)
1078
1079Therefore, you should take care that the shell does not ask any
1080questions when invoked from @tramp{}. You can do this by checking the
1081@code{TERM} environment variable, it will be set to @code{dumb} when
1082connecting.
1083
1084@vindex tramp-terminal-type
1085The variable @code{tramp-terminal-type} can be used to change this value
1086@code{dumb}.
1087
1088@end itemize
1089
1090
1091@node Windows setup hints
1092@section Issues with Cygwin ssh
1093
1094This section needs a lot of work! Please help.
1095
1096If you use the Cygwin installation of ssh (you have to explicitly select
1097it in the installer), then it should work out of the box to just select
1098@code{smx} as the connection method. You can find information about
1099setting up Cygwin in their FAQ at @uref{http://cygwin.com/faq/}.
1100
1101
1102@node Usage
1103@chapter Using @tramp
1104
1105Once you have installed @tramp{} it will operate fairly transparently. You
1106will be able to access files on any remote machine that you can log in
1107to as though they were local.
1108
1109Files are specified to @tramp{} using a formalized syntax specifying the
1110details of the system to connect to. This is similar to the syntax used
1111by the @command{EFS} and @command{ange-ftp} packages.
1112
1113
1114@menu
1115* Filename Syntax:: @tramp{} filename conventions.
1116* Multi-hop filename syntax:: Multi-hop filename conventions
1117* Dired:: Dired and filename completion.
1118@end menu
1119
1120
1121@node Filename Syntax
1122@section @tramp{} filename conventions
1123
1124To access the file <path> on the remote machine <machine> you would
1125specify the filename @file{/[<machine>]<path>}. (The square brackets
1126are part of the file name.) This will connect to <machine> and transfer
1127the file using the default method. @xref{Default Method}.
1128
1129Some examples of @tramp{} filenames are:
1130
1131@table @file
1132@item /[melancholia].emacs
1133Edit the file @file{.emacs} in your home directory on the machine
1134@code{melancholia}.
1135
1136@item /[melancholia.danann.net].emacs
1137This edits the same file, using the fully qualified domain name of
1138the machine.
1139
1140@item /[melancholia]~/.emacs
1141This also edits the same file --- the @file{~} is expanded to your
1142home directory on the remote machine, just like it is locally.
1143
1144@item /[melancholia]~daniel/.emacs
1145This edits the file @file{.emacs} in the home directory of the user
1146@code{daniel} on the machine @code{melancholia}. The @file{~<user>}
1147construct is expanded to the home directory of that user on the remote
1148machine.
1149
1150@item /[melancholia]/etc/squid.conf
1151This edits the file @file{/etc/squid.conf} on the machine
1152@code{melancholia}.
1153
1154@end table
1155
1156
1157Unless you specify a different name to use, @tramp{} will use the current
1158local user name as the remote user name to log in with. If you need to
1159log in as a different user, you can specify the user name as part of the
1160filename.
1161
1162To log in to the remote machine as a specific user, you use the syntax
1163@file{/[<user>@@<machine>]/path/to.file}. That means that connecting to
1164@code{melancholia} as @code{daniel} and editing @file{.emacs} in your
1165home directory you would specify @file{/[daniel@@melancholia].emacs}.
1166
1167
1168It is also possible to specify other file transfer methods
1169(@pxref{Default Method}) as part of the filename. This is done by
1170replacing the initial @file{/[} with @file{/[<method>/}. (Note the
1171trailing slash!) The user, machine and file specification remain the
1172same.
1173
1174So, to connect to the machine @code{melancholia} as @code{daniel}, using
1175the @option{su} method to transfer files, and edit @file{.emacs} in my
1176home directory I would specify the filename
1177@file{/[su/daniel@@melancholia].emacs}.
1178
1179
1180@node Multi-hop filename syntax
1181@section Multi-hop filename conventions
1182
1183The syntax of multi-hop file names is necessarily slightly different
1184than the syntax of other @tramp{} file names. Here's an example multi-hop
1185file name:
1186
1187@file{/[multi/rsh:out@@gate/telnet:kai@@real.host]/path/to.file}
1188
1189This is quite a mouthful. So let's go through it step by step. The
1190file name consists of three parts, separated by slashes and square
1191brackets. The first part is @file{/[multi}, the method specification.
1192The second part is @file{rsh:out@@gate/telnet:kai@@real.host} and
1193specifies the hops. (Yes, the second part may contain even more
1194slashes, so that's why this file name has more than two colons in it.)
1195The final part is @file{/path/to.file} and specifies the file name on
1196the remote host.
1197
1198The first part and the final part should be clear. @ref{Multi-hop
1199Methods}, for a list of alternatives for the method specification.
1200
1201The second part can be subdivided again into components, so-called hops.
1202In the above file name, there are two hops, @file{rsh:out@@gate} and
1203@file{telnet:kai@@real.host}.
1204
1205Each hop can @emph{again} be subdivided into (three) components, the
1206@dfn{hop method}, the @dfn{user name} and the @dfn{host name}. The
1207meaning of the second and third component should be clear, and the hop
1208method says what program to use to perform that hop.
1209
1210The first hop, @file{rsh:out@@gate}, says to use @command{rsh} to log in
1211as user @code{out} to the host @code{gate}. Starting at that host, the
1212second hop, @file{telnet:kai@@real.host}, says to use @command{telnet}
1213to log in as user @code{kai} to host @code{real.host}.
1214
1215@xref{Multi-hop Methods}, for a list of possible hop method values. The
1216variable @var{tramp-multi-connection-function-alist} contains the list of
1217possible hop methods and information on how to execute them, should you
1218want to add your own.
1219
1220
1221@node Dired
1222@section Dired and filename completion
1223
1224@tramp{} works transparently with dired, enabling you to use this powerful
1225file management tool to manage files on any machine you have access to
1226over the Internet.
1227
1228Filename completion also works with @tramp{} for files on remote machines
1229although there is no completion for user names or machine names at this
1230stage.
1231
1232As filename completion needs to fetch the listing of files from the
1233remote machine, this feature is sometimes fairly slow. As @tramp{} does not
1234yet cache the results of directory listing, there is no gain in
1235performance the second time you complete filenames.
1236
1237If you need to browse a directory tree, Dired is a better choice, at
1238present, than filename completion. Dired has its own cache mechanism
1239and will only fetch the directory listing once.
1240
1241
1242@node Bug Reports
1243@chapter Reporting Bugs and Problems
1244
1245Bugs and problems with @tramp{} are actively worked on by the development
1246team. Feature requests and suggestions are also more than welcome.
1247
1248The @tramp{} mailing list is a great place to get information on working
1249with @tramp{}, solving problems and general discussion and advice on topics
1250relating to the package.
1251
1252The mailing list is at @email{tramp-devel@@mail.freesoftware.fsf.org}.
1253Messages sent to this address go to all the subscribers. This is
1254@emph{not} the address to send subscription requests to.
1255
1256For help on subscribing to the list, send mail to the administrative
1257address, @email{tramp-devel-request@@mail.freesoftware.fsf.org}, with the
1258subject @samp{help}.
1259
1260To report a bug in @tramp{}, you should execute @kbd{M-x tramp-bug}. This
1261will automatically generate a buffer with the details of your system and
1262@tramp{} version.
1263
1264When submitting a bug report, please try to describe in excruciating
1265detail the steps required to reproduce the problem, the setup of the
1266remote machine and any special conditions that exist.
1267
1268If you can identify a minimal test case that reproduces the problem,
1269include that with your bug report. This will make it much easier for the
1270development team to analyze and correct the problem.
1271
1272@node Frequently Asked Questions
1273@chapter Frequently Asked Questions
1274
1275@itemize @bullet
1276@item Where can I get the latest @tramp{}?
1277
1278@tramp{} is available at
1279@uref{ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz}.
1280There is also a Savannah project page, at
1281@uref{https://savannah.gnu.org/projects/tramp/}.
1282
1283
1284@item Which systems does it work on?
1285
1286The package has been used successfully on Emacs 20 and Emacs 21, as well
1287as XEmacs 21. XEmacs 20 is more problematic, see the notes in
1288@file{tramp.el}. I don't think anybody has really tried it on Emacs 19.
1289
1290The package was intended to work on Unix, and it really expects a
1291Unix-like system on the remote end, but some people seemed to have some
1292success getting it to work on NT Emacs.
1293
1294There are some informations on Tramp on NT at the following URL; many
1295thanks to Joe Stoy for providing the information:
1296@uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/}
1297
1298The above mostly contains patches to old ssh versions; Tom Roche has a
1299Web page with instructions:
1300@uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html}
1301
1302??? Is the XEmacs info correct?
1303
1304??? Can somebody provide some information for getting it to work on NT
1305Emacs? I think there was some issue with @command{ssh}?
1306
1307
1308@item I can't stop EFS starting with XEmacs
1309
1310Not all the older versions of @tramp{} supported XEmacs correctly. The
1311first thing to do is to make sure that you have the latest version of
1312@tramp{} installed.
1313
1314If you do, please try and find out exactly the conditions required for
1315the @code{EFS} handlers to fire. If you can, putting a breakpoint on
1316@code{efs-ftp-path} and sending in the stack trace along with your bug
1317report would make it easier for the developers to work out what is going
1318wrong.
1319
1320
1321@item File name completion does not work with @tramp{}
1322
1323When you log in to the remote machine, do you see the output of
1324@command{ls} in color? If so, this may be the cause of your problems.
1325
1326@command{ls} outputs @acronym{ANSI} escape sequences that your terminal
1327emulator interprets to set the colors. These escape sequences will
1328confuse @tramp{} however.
1329
1330In your @file{.bashrc}, @file{.profile} or equivalent on the remote
1331machine you probably have an alias configured that adds the option
1332@option{--color=yes} or @option{--color=auto}.
1333
1334You should remove that alias and ensure that a new login @emph{does not}
1335display the output of @command{ls} in color. If you still cannot use
1336filename completion, report a bug to the @tramp{} developers.
1337
1338
1339@item File name completion does not work in large directories
1340
1341@tramp{} uses globbing for some operations. (Globbing means to use the
1342shell to expand wildcards such as `*.c'.) This might create long
1343command lines, especially in directories with many files. Some shell
1344choke on long command lines, or don't cope well with the globbing
1345itself.
1346
1347If you have a large directory on the remote end, you may wish to execute
1348a command like @command{ls -d * ..?* > /dev/null} and see if it hangs.
1349Note that you must first start the right shell, which might be
1350@command{/bin/sh}, @command{ksh} or @command{bash}, depending on which
1351of those supports tilde expansion.
1352
1353
1354@item What kinds of systems does @tramp{} work on
1355
1356@tramp{} really expects the remote system to be a Unix-like system. The
1357local system should preferably be Unix-like, as well, but @tramp{} might
1358work on NT with some tweaking.
1359
1360
1361@item How can I get notified when @tramp{} file transfers are complete?
1362
1363The following snippet can be put in your @file{~/.emacs} file. It makes
1364Emacs beep after reading from or writing to the remote host.
1365
1366@lisp
1367(defadvice tramp-handle-write-region
1368 (after tramp-write-beep-advice activate)
1369 " make tramp beep after writing a file."
1370 (interactive)
1371 (beep))
1372(defadvice tramp-handle-do-copy-or-rename-file
1373 (after tramp-copy-beep-advice activate)
1374 " make tramp beep after copying a file."
1375 (interactive)
1376 (beep))
1377(defadvice tramp-handle-insert-file-contents
1378 (after tramp-copy-beep-advice activate)
1379 " make tramp beep after copying a file."
1380 (interactive)
1381 (beep))
1382@end lisp
1383
1384
1385@item There's this @file{~/.sh_history} file on the remote host which
1386 keeps growing and growing. What's that?
1387
1388Sometimes, @tramp{} starts @code{ksh} on the remote host for tilde
1389expansion. Maybe @code{ksh} saves the history by default. @tramp{}
1390tries to turn off saving the history, but maybe you have to help. For
1391example, you could put this in your @file{.kshrc}:
1392
1393@example
1394if [ -f $HOME/.sh_history ] ; then
1395 /bin/rm $HOME/.sh_history
1396fi
1397if [ "$@{HISTFILE-unset@}" != "unset" ] ; then
1398 unset HISTFILE
1399fi
1400if [ "$@{HISTSIZE-unset@}" != "unset" ] ; then
1401 unset HISTSIZE
1402fi
1403@end example
1404
1405@end itemize
1406
1407
1408@c For the developer
1409@node Version Control
1410@chapter The inner workings of remote version control
1411
1412Unlike EFS and ange-ftp, @tramp{} has full shell access to the remote
1413machine. This makes it possible to provide version control for files
1414accessed under @tramp{}.
1415
1416The actual version control binaries must be installed on the remote
1417machine, accessible in the directories specified in
1418@var{tramp-remote-path}.
1419
1420This transparent integration with the version control systems is one of
1421the most valuable features provided by @tramp{}, but it is far from perfect.
1422Work is ongoing to improve the transparency of the system.
1423
1424@menu
1425* Version Controlled Files:: Determining if a file is under version control.
1426* Remote Commands:: Executing the version control commands on the remote machine.
1427* Changed workfiles:: Detecting if the working file has changed.
1428* Checking out files:: Bringing the workfile out of the repository.
1429* Miscellaneous Version Control:: Things related to Version Control that don't fit elsewhere
1430@end menu
1431
1432
1433@node Version Controlled Files
1434@section Determining if a file is under version control
1435
1436The VC package uses the existence of on-disk revision control master
1437files to determine if a given file is under revision control. These file
1438tests happen on the remote machine through the standard @tramp{} mechanisms.
1439
1440
1441@node Remote Commands
1442@section Executing the version control commands on the remote machine
1443
1444There are no hooks provided by VC to allow intercepting of the version
1445control command execution. The calls occur through the
1446@code{call-process} mechanism, a function that is somewhat more
1447efficient than the @code{shell-command} function but that does not
1448provide hooks for remote execution of commands.
1449
1450To work around this, the functions @code{vc-do-command} and
1451@code{vc-simple-command} have been advised to intercept requests for
1452operations on files accessed via @tramp{}.
1453
1454In the case of a remote file, the @code{shell-command} interface is
1455used, with some wrapper code, to provide the same functionality on the
1456remote machine as would be seen on the local machine.
1457
1458
1459@node Changed workfiles
1460@section Detecting if the working file has changed
1461
1462As there is currently no way to get access to the mtime of a file on a
1463remote machine in a portable way, the @code{vc-workfile-unchanged-p}
1464function is advised to call an @tramp{} specific function for remote files.
1465
1466The @code{tramp-vc-workfile-unchanged-p} function uses the functioning VC
1467diff functionality to determine if any changes have occurred between the
1468workfile and the version control master.
1469
1470This requires that a shell command be executed remotely, a process that
1471is notably heavier-weight than the mtime comparison used for local
1472files. Unfortunately, unless a portable solution to the issue is found,
1473this will remain the cost of remote version control.
1474
1475
1476@node Checking out files
1477@section Bringing the workfile out of the repository
1478
1479VC will, by default, check for remote files and refuse to act on them
1480when checking out files from the repository. To work around this
1481problem, the function @code{vc-checkout} knows about @tramp{} files and
1482allows version control to occur.
1483
1484
1485@node Miscellaneous Version Control
1486@section Things related to Version Control that don't fit elsewhere
1487
1488Minor implementation details, &c.
1489
1490@menu
1491* Remote File Ownership:: How VC determines who owns a workfile.
1492* Back-end Versions:: How VC determines what release your RCS is.
1493@end menu
1494
1495
1496@node Remote File Ownership
1497@subsection How VC determines who owns a workfile
1498
1499Emacs provides the @code{user-full-name} function to return the login name
1500of the current user as well as mapping from arbitrary user id values
1501back to login names. The VC code uses this functionality to map from the
1502uid of the owner of a workfile to the login name in some circumstances.
1503
1504This will not, for obvious reasons, work if the remote system has a
1505different set of logins. As such, it is necessary to delegate to the
1506remote machine the job of determining the login name associated with a
1507uid.
1508
1509Unfortunately, with the profusion of distributed management systems such
1510as @code{NIS}, @code{NIS+} and @code{NetInfo}, there is no simple,
1511reliable and portable method for performing this mapping.
1512
1513Thankfully, the only place in the VC code that depends on the mapping of
1514a uid to a login name is the @code{vc-file-owner} function. This returns
1515the login of the owner of the file as a string.
1516
1517This function has been advised to use the output of @command{ls} on the
1518remote machine to determine the login name, delegating the problem of
1519mapping the uid to the login to the remote system which should know more
1520about it than I do.
1521
1522
1523@node Back-end Versions
1524@subsection How VC determines what release your RCS is
1525
1526VC needs to know what release your revision control binaries you are
1527running as not all features VC supports are available with older
1528versions of @command{rcs(1)}, @command{cvs(1)} or @command{sccs(1)}.
1529
1530The default implementation of VC determines this value the first time it
1531is needed and then stores the value globally to avoid the overhead of
1532executing a process and parsing its output each time the information is
1533needed.
1534
1535Unfortunately, life is not quite so easy when remote version control
1536comes into the picture. Each remote machine may have a different version
1537of the version control tools and, while this is painful, we need to
1538ensure that unavailable features are not used remotely.
1539
1540To resolve this issue, @tramp{} currently takes the sledgehammer
1541approach of making the release values of the revision control tools
1542local to each @tramp{} buffer, forcing VC to determine these values
1543again each time a new file is visited.
1544
1545This has, quite obviously, some performance implications. Thankfully,
1546most of the common operations performed by VC do not actually require
1547that the remote version be known. This makes the problem far less
1548apparent.
1549
1550Eventually these values will be captured by @tramp{} on a system by
1551system basis and the results cached to improve performance.
1552
1553
1554@node Files directories and paths
1555@chapter How file names, directories and paths are mangled and managed.
1556
1557@menu
1558* Path deconstruction:: Breaking a path into its components.
1559@end menu
1560
1561
1562@node Path deconstruction
1563@section Breaking a path into its components.
1564
1565@tramp{} filenames are somewhat different, obviously, to ordinary path
1566names. As such, the lisp functions @code{file-name-directory} and
1567@code{file-name-nondirectory} are overridden within the @tramp{} package.
1568
1569Their replacements are reasonably simplistic in their approach. They
1570dissect the filename, call the original handler on the remote path and
1571then rebuild the @tramp{} path with the result.
1572
1573This allows the platform specific hacks in the original handlers to take
1574effect while preserving the @tramp{} path information.
1575
1576
1577@node Issues
1578@chapter Debatable Issues and What Was Decided
1579
1580@itemize @bullet
1581@item The uuencode method does not always work.
1582
1583Due to the design of @tramp{}, the encoding and decoding programs need to
1584read from stdin and write to stdout. On some systems, @code{uudecode -o
1585-} will read stdin and write the decoded file to stdout, on other
1586systems @code{uudecode -p} does the same thing. But some systems have
1587uudecode implementations which cannot do this at all---it is not
1588possible to call these uudecode implementations with suitable parameters
1589so that they write to stdout.
1590
1591Of course, this could be circumvented: the @code{begin foo 644} line
1592could be rewritten to put in some temporary file name, then
1593@code{uudecode} could be called, then the temp file could be printed and
1594deleted.
1595
1596But I have decided that this is too fragile to reliably work, so on some
1597systems you'll have to do without the uuencode methods.
1598
1599@item @tramp{} does not work on XEmacs 20.
1600
1601This is because it requires the macro @code{with-timeout} which does not
1602appear to exist in XEmacs 20. I'm somewhat reluctant to add an
1603emulation macro to @tramp{}, but if somebody who uses XEmacs 20 steps
1604forward and wishes to implement and test it, please contact me or the
1605mailing list.
1606
1607@end itemize
1608
1609
1610@c End of tramp.texi - the TRAMP User Manual
1611@bye
1612
1613@c TODO
1614@c
1615@c * Say something about the .login and .profile files of the remote
1616@c shells.
1617@c * Explain how tramp.el works in principle: open a shell on a remote
1618@c host and then send commands to it.
1619
1620@c Local Variables:
1621@c eval: (add-hook 'write-file-hooks 'time-stamp)
1622@c time-stamp-start: "@set UPDATED "
1623@c time-stamp-format: "%:a, %:d %:b, %:y"
1624@c time-stamp-end: "$"
1625@c time-stamp-line-limit: 50
1626@c End: