1 \input texinfo @c -*-texinfo-*-
2 @setfilename ../../info/tramp
4 @settitle TRAMP User Manual
5 @documentencoding UTF-8
8 @c This is *so* much nicer :)
11 @c In the Tramp repository, the version number is auto-frobbed from
12 @c configure.ac, so you should edit that file and run
13 @c "autoconf && ./configure" to change the version number.
15 @c Additionally, flags are set with respect to the Emacs flavor; and
16 @c depending whether Tramp is packaged into (X)Emacs, or standalone.
18 @include trampver.texi
20 @c Macro for formatting a file name according to the respective syntax.
21 @c xxx and yyy are auxiliary macros in order to omit leading and
22 @c trailing whitespace. Not very elegant, but I don't know it better.
24 @c There are subtle differences between texinfo 4.13 and 5.0. We must
25 @c declare two versions of the macro. This will be improved, hopefully.
28 @ifset txicommandconditionals
41 @macro trampfn {method, user, host, localname}
43 @yyy{\method\,@value{postfixhop}}@c
45 \host\@value{postfix}\localname\
50 @ifclear txicommandconditionals
55 @macro yyy {one, two}@c
63 @macro trampfn {method, user, host, localname}@c
64 @value{prefix}@yyy{\method\,@value{postfixhop}}@yyy{\user\,@@}\host\@value{postfix}\localname\@c
69 Copyright @copyright{} 1999--2014 Free Software Foundation, Inc.
72 Permission is granted to copy, distribute and/or modify this document
73 under the terms of the GNU Free Documentation License, Version 1.3 or
74 any later version published by the Free Software Foundation; with no
75 Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
76 and with the Back-Cover Texts as in (a) below. A copy of the license
77 is included in the section entitled ``GNU Free Documentation License''.
79 (a) The FSF's Back-Cover Text is: ``You have the freedom to
80 copy and modify this GNU manual.''
84 @c Entries for @command{install-info} to use
85 @dircategory @value{emacsname} network features
87 * TRAMP: (tramp). Transparent Remote Access, Multiple Protocol
88 @value{emacsname} remote file access via ssh and scp.
92 @title @value{tramp} version @value{trampver} User Manual
93 @author by Daniel Pittman
94 @author based on documentation by Kai Gro@ss{}johann
102 @node Top, Overview, (dir), (dir)
103 @top @value{tramp} version @value{trampver} User Manual
105 This file documents @value{tramp} version @value{trampver}, a remote file
106 editing package for @value{emacsname}.
108 @value{tramp} stands for `Transparent Remote (file) Access, Multiple
109 Protocol'. This package provides remote file editing, similar to
110 @value{ftppackagename}.
112 The difference is that @value{ftppackagename} uses FTP to transfer
113 files between the local and the remote host, whereas @value{tramp} uses a
114 combination of @command{rsh} and @command{rcp} or other work-alike
115 programs, such as @command{ssh}/@command{scp}.
117 You can find the latest version of this document on the web at
118 @uref{http://www.gnu.org/software/tramp/}.
120 @c Pointer to the other Emacs flavor is necessary only in case of
121 @c standalone installation.
122 @ifset installchapter
123 The manual has been generated for @value{emacsname}.
125 If you want to read the info pages for @value{emacsothername}, you
126 should read in @ref{Installation} how to create them.
129 If you're using the other Emacs flavor, you should read the
130 @uref{@value{emacsotherfilename}, @value{emacsothername}} pages.
135 The latest release of @value{tramp} is available for
136 @uref{ftp://ftp.gnu.org/gnu/tramp/, download}, or you may see
137 @ref{Obtaining Tramp} for more details, including the Git server
140 @value{tramp} also has a @uref{http://savannah.gnu.org/projects/tramp/,
141 Savannah Project Page}.
144 There is a mailing list for @value{tramp}, available at
145 @email{tramp-devel@@gnu.org}, and archived at
146 @uref{http://lists.gnu.org/archive/html/tramp-devel/, the
147 @value{tramp} Mail Archive}.
149 Older archives are located at
150 @uref{http://sourceforge.net/mailarchive/forum.php?forum=tramp-devel,
151 SourceForge Mail Archive} and
152 @uref{http://www.mail-archive.com/emacs-rcp@@ls6.cs.uni-dortmund.de/,
154 @c in HTML output, there's no new paragraph.
163 * Overview:: What @value{tramp} can and cannot do.
167 * Obtaining Tramp:: How to obtain @value{tramp}.
168 * History:: History of @value{tramp}.
169 @ifset installchapter
170 * Installation:: Installing @value{tramp} with your @value{emacsname}.
172 * Configuration:: Configuring @value{tramp} for use.
173 * Usage:: An overview of the operation of @value{tramp}.
174 * Bug Reports:: Reporting Bugs and Problems.
175 * Frequently Asked Questions:: Questions and answers from the mailing list.
179 * Files directories and localnames:: How file names, directories and localnames are mangled and managed.
180 * Traces and Profiles:: How to Customize Traces.
181 * Issues:: Debatable Issues and What Was Decided.
183 * GNU Free Documentation License:: The license for this documentation.
184 * Function Index:: @value{tramp} functions.
185 * Variable Index:: User options and variables.
186 * Concept Index:: An item for each concept.
189 --- The Detailed Node Listing ---
191 @ifset installchapter
192 Installing @value{tramp} with your @value{emacsname}
194 * Installation parameters:: Parameters in order to control installation.
195 * Load paths:: How to plug-in @value{tramp} into your environment.
199 Configuring @value{tramp} for use
201 * Connection types:: Types of connections made to remote hosts.
202 * Inline methods:: Inline methods.
203 * External methods:: External methods.
205 * GVFS based methods:: GVFS based external methods.
208 * Gateway methods:: Gateway methods.
210 * Default Method:: Selecting a default method.
211 * Default User:: Selecting a default user.
212 * Default Host:: Selecting a default host.
213 * Multi-hops:: Connecting to a remote host using multiple hops.
214 * Customizing Methods:: Using Non-Standard Methods.
215 * Customizing Completion:: Selecting config files for user/host name completion.
216 * Password handling:: Reusing passwords for several connections.
217 * Connection caching:: Reusing connection related information.
218 * Predefined connection information::
219 Setting own connection related information.
220 * Remote Programs:: How @value{tramp} finds and uses programs on the remote host.
221 * Remote shell setup:: Remote shell setup hints.
222 * Android shell setup:: Android shell setup hints.
223 * Auto-save and Backup:: Auto-save and Backup.
224 * Windows setup hints:: Issues with Cygwin ssh.
228 * File name Syntax:: @value{tramp} file name conventions.
229 * File name completion:: File name completion.
230 * Ad-hoc multi-hops:: Declaring multiple hops in the file name.
231 * Remote processes:: Integration with other @value{emacsname} packages.
232 * Cleanup remote connections:: Cleanup remote connections.
234 How file names, directories and localnames are mangled and managed
236 * Localname deconstruction:: Breaking a localname into its components.
238 * External packages:: Integration with external Lisp packages.
246 @chapter An overview of @value{tramp}
249 After the installation of @value{tramp} into your @value{emacsname}, you
250 will be able to access files on remote hosts as though they were
251 local. Access to the remote file system for editing files, version
252 control, and @code{dired} are transparently enabled.
254 Your access to the remote host can be with the @command{rsh},
255 @command{rlogin}, @command{telnet} programs or with any similar
256 connection method. This connection must pass @acronym{ASCII}
257 successfully to be usable but need not be 8-bit clean.
259 The package provides support for @command{ssh} connections out of the
260 box, one of the more common uses of the package. This allows
261 relatively secure access to hosts, especially if @command{ftp}
264 Under Windows, @value{tramp} is integrated with the PuTTY package,
265 using the @command{plink} program.
267 The majority of activity carried out by @value{tramp} requires only that
268 the remote login is possible and is carried out at the terminal. In
269 order to access remote files @value{tramp} needs to transfer their content
270 to the local host temporarily.
272 @value{tramp} can transfer files between the hosts in a variety of ways.
273 The details are easy to select, depending on your needs and the
276 The fastest transfer methods for large files rely on a remote file
277 transfer package such as @command{rcp}, @command{scp}, @command{rsync}
278 or (under Windows) @command{pscp}.
280 If the remote copy methods are not suitable for you, @value{tramp} also
281 supports the use of encoded transfers directly through the shell.
282 This requires that the @command{mimencode} or @command{uuencode} tools
283 are available on the remote host. These methods are generally
284 faster for small files.
286 @value{tramp} is still under active development and any problems you encounter,
287 trivial or major, should be reported to the @value{tramp} developers.
291 @subsubheading Behind the scenes
292 @cindex behind the scenes
293 @cindex details of operation
296 This section tries to explain what goes on behind the scenes when you
297 access a remote file through @value{tramp}.
299 Suppose you type @kbd{C-x C-f} and enter part of an @value{tramp} file name,
300 then hit @kbd{@key{TAB}} for completion. Suppose further that this is
301 the first time that @value{tramp} is invoked for the host in question. Here's
306 @value{tramp} discovers that it needs a connection to the host. So it
307 invokes @samp{telnet @var{host}} or @samp{rsh @var{host} -l
308 @var{user}} or a similar tool to connect to the remote host.
309 Communication with this process happens through an
310 @value{emacsname} buffer, that is, the output from the remote end
314 The remote host may prompt for a login name (for @command{telnet}).
315 The login name is given in the file name, so @value{tramp} sends the
316 login name and a newline.
319 The remote host may prompt for a password or pass phrase (for
320 @command{rsh} or for @command{telnet} after sending the login name).
321 @value{tramp} displays the prompt in the minibuffer, asking you for the
322 password or pass phrase.
324 You enter the password or pass phrase. @value{tramp} sends it to the remote
325 host, followed by a newline.
328 @value{tramp} now waits for the shell prompt or for a message that the login
331 If @value{tramp} sees neither of them after a certain period of time
332 (a minute, say), then it issues an error message saying that it
333 couldn't find the remote shell prompt and shows you what the remote
336 If @value{tramp} sees a @samp{login failed} message, it tells you so,
337 aborts the login attempt and allows you to try again.
340 Suppose that the login was successful and @value{tramp} sees the shell prompt
341 from the remote host. Now @value{tramp} invokes @command{/bin/sh} because
342 Bourne shells and C shells have different command
343 syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login
344 shell doesn't recognize @samp{exec /bin/sh} as a valid command.
345 Maybe you use the Scheme shell @command{scsh}@dots{}}
347 After the Bourne shell has come up, @value{tramp} sends a few commands to
348 ensure a good working environment. It turns off echoing, it sets the
349 shell prompt, and a few other things.
352 Now the remote shell is up and it good working order. Remember, what
353 was supposed to happen is that @value{tramp} tries to find out what files exist
354 on the remote host so that it can do file name completion.
356 So, @value{tramp} basically issues @command{cd} and @command{ls} commands and
357 also sometimes @command{echo} with globbing. Another command that is
358 often used is @command{test} to find out whether a file is writable or a
359 directory or the like. The output of each command is parsed for the
363 Suppose you are finished with file name completion, have entered @kbd{C-x
364 C-f}, a full file name and hit @kbd{@key{RET}}. Now comes the time to
365 transfer the file contents from the remote host to the local host so
366 that you can edit them.
368 See above for an explanation of how @value{tramp} transfers the file contents.
370 For inline transfers, @value{tramp} issues a command like @samp{mimencode -b
371 /path/to/remote/file}, waits until the output has accumulated in the
372 buffer that's used for communication, then decodes that output to
373 produce the file contents.
375 For external transfers, @value{tramp} issues a command like the
378 rcp user@@host:/path/to/remote/file /tmp/tramp.4711
380 It then reads the local temporary file @file{/tmp/tramp.4711} into a
381 buffer and deletes the temporary file.
384 You now edit the buffer contents, blithely unaware of what has happened
385 behind the scenes. (Unless you have read this section, that is.) When
386 you are finished, you type @kbd{C-x C-s} to save the buffer.
389 Again, @value{tramp} transfers the file contents to the remote host
390 either inline or external. This is the reverse of what happens when
394 I hope this has provided you with a basic overview of what happens
395 behind the scenes when you open a file with @value{tramp}.
399 @node Obtaining Tramp
400 @chapter Obtaining Tramp.
401 @cindex obtaining Tramp
403 @value{tramp} is freely available on the Internet and the latest
404 release may be downloaded from @uref{ftp://ftp.gnu.org/gnu/tramp/}.
405 This release includes the full documentation and code for
406 @value{tramp}, suitable for installation. But Emacs (22 or later)
407 includes @value{tramp} already, and there is a @value{tramp} package
408 for XEmacs, as well. So maybe it is easier to just use those. But if
409 you want the bleeding edge, read on@dots{}
411 For the especially brave, @value{tramp} is available from Git. The Git
412 version is the latest version of the code and may contain incomplete
413 features or new issues. Use these versions at your own risk.
415 Instructions for obtaining the latest development version of @value{tramp}
416 from Git can be found by going to the Savannah project page at the
417 following URL and then clicking on the Git link in the navigation bar
421 @uref{http://savannah.gnu.org/projects/tramp/}
424 Or follow the example session below:
427 ] @strong{cd ~/@value{emacsdir}}
428 ] @strong{git clone git://git.savannah.gnu.org/tramp.git}
432 Tramp developers use instead
435 ] @strong{git clone login@@git.sv.gnu.org:/srv/git/tramp.git}
439 You should now have a directory @file{~/@value{emacsdir}/tramp}
440 containing the latest version of @value{tramp}. You can fetch the latest
441 updates from the repository by issuing the command:
444 ] @strong{cd ~/@value{emacsdir}/tramp}
449 Once you've got updated files from the Git repository, you need to run
450 @command{autoconf} in order to get an up-to-date @file{configure}
454 ] @strong{cd ~/@value{emacsdir}/tramp}
460 @chapter History of @value{tramp}
462 @cindex development history
464 Development was started end of November 1998. The package was called
465 @file{rssh.el}, back then. It only provided one method to access a
466 file, using @command{ssh} to log in to a remote host and using
467 @command{scp} to transfer the file contents. After a while, the name
468 was changed to @file{rcp.el}, and now it's @value{tramp}. Along the way,
469 many more methods for getting a remote shell and for transferring the
470 file contents were added. Support for VC was added.
472 After that, there were added the multi-hop methods in April 2000 and
473 the unification of @value{tramp} and Ange-FTP file names in July 2002.
474 In July 2004, multi-hop methods have been replaced by proxy hosts.
475 Running commands on remote hosts was introduced in December 2005.
477 Support of gateways exists since April 2007.
480 GVFS integration started in February 2009.
483 Remote commands on Windows hosts are available since September 2011.
485 Ad-hoc multi-hop methods (with a changed syntax) have been reenabled
486 in November 2011. In November 2012, Juergen Hoetzel's
487 @file{tramp-adb.el} has been added.
489 In December 2001, @value{tramp} has been added to the XEmacs package
490 repository. Being part of the Emacs repository happened in June 2002,
491 the first release including @value{tramp} was Emacs 22.1.
493 @value{tramp} is also a Debian GNU/Linux package since February 2001.
496 @c Installation chapter is necessary only in case of standalone
497 @c installation. Text taken from trampinst.texi.
498 @ifset installchapter
499 @include trampinst.texi
504 @chapter Configuring @value{tramp} for use
505 @cindex configuration
507 @cindex default configuration
508 @value{tramp} is (normally) fully functional when it is initially
509 installed. It is initially configured to use the @command{scp}
510 program to connect to the remote host. So in the easiest case, you
511 just type @kbd{C-x C-f} and then enter the file name
512 @file{@trampfn{, user, host, /path/to.file}}.
514 On some hosts, there are problems with opening a connection. These are
515 related to the behavior of the remote shell. See @xref{Remote shell
516 setup}, for details on this.
518 If you do not wish to use these commands to connect to the remote
519 host, you should change the default connection and transfer method
520 that @value{tramp} uses. There are several different methods that @value{tramp}
521 can use to connect to remote hosts and transfer files
522 (@pxref{Connection types}).
524 If you don't know which method is right for you, see @xref{Default
529 * Connection types:: Types of connections made to remote hosts.
530 * Inline methods:: Inline methods.
531 * External methods:: External methods.
533 * GVFS based methods:: GVFS based external methods.
536 * Gateway methods:: Gateway methods.
538 * Default Method:: Selecting a default method.
539 Here we also try to help those who
540 don't have the foggiest which method
542 * Default User:: Selecting a default user.
543 * Default Host:: Selecting a default host.
544 * Multi-hops:: Connecting to a remote host using multiple hops.
545 * Customizing Methods:: Using Non-Standard Methods.
546 * Customizing Completion:: Selecting config files for user/host name completion.
547 * Password handling:: Reusing passwords for several connections.
548 * Connection caching:: Reusing connection related information.
549 * Predefined connection information::
550 Setting own connection related information.
551 * Remote Programs:: How @value{tramp} finds and uses programs on the remote host.
552 * Remote shell setup:: Remote shell setup hints.
553 * Android shell setup:: Android shell setup hints.
554 * Auto-save and Backup:: Auto-save and Backup.
555 * Windows setup hints:: Issues with Cygwin ssh.
559 @node Connection types
560 @section Types of connections made to remote hosts
561 @cindex connection types, overview
563 There are two basic types of transfer methods, each with its own
564 advantages and limitations. Both types of connection make use of a
565 remote shell access program such as @command{rsh}, @command{ssh} or
566 @command{telnet} to connect to the remote host.
568 This connection is used to perform many of the operations that @value{tramp}
569 requires to make the remote file system transparently accessible from
570 the local host. It is only when visiting files that the methods
573 @cindex inline methods
574 @cindex external methods
575 @cindex methods, inline
576 @cindex methods, external
577 Loading or saving a remote file requires that the content of the file
578 be transferred between the two hosts. The content of the file can
579 be transferred using one of two methods: the @dfn{inline method} over
580 the same connection used to log in to the remote host, or the
581 @dfn{external method} through another connection using a remote copy
582 program such as @command{rcp}, @command{scp} or @command{rsync}.
584 The performance of the external methods is generally better than that
585 of the inline methods, at least for large files. This is caused by
586 the need to encode and decode the data when transferring inline.
588 The one exception to this rule are the @command{scp} based transfer
589 methods. While these methods do see better performance when actually
590 transferring files, the overhead of the cryptographic negotiation at
591 startup may drown out the improvement in file transfer times.
593 External methods should be configured such a way that they don't
594 require a password (with @command{ssh-agent}, or such alike). Modern
595 @command{scp} implementations offer options to reuse existing
596 @command{ssh} connections, which will be enabled by default if
597 available. If it isn't possible, you should consider @ref{Password
598 handling}, otherwise you will be prompted for a password every copy
603 @section Inline methods
604 @cindex inline methods
605 @cindex methods, inline
607 The inline methods in @value{tramp} are quite powerful and can work in
608 situations where you cannot use an external transfer program to connect.
609 Inline methods are the only methods that work when connecting to the
610 remote host via telnet. (There are also strange inline methods which
611 allow you to transfer files between @emph{user identities} rather than
614 These methods depend on the existence of a suitable encoding and
615 decoding command on remote host. Locally, @value{tramp} may be able to
616 use features of @value{emacsname} to decode and encode the files or
617 it may require access to external commands to perform that task.
621 @cindex base-64 encoding
622 @value{tramp} checks the availability and usability of commands like
623 @command{mimencode} (part of the @command{metamail} package) or
624 @command{uuencode} on the remote host. The first reliable command
625 will be used. The search path can be customized, see @ref{Remote
628 If both commands aren't available on the remote host, @value{tramp}
629 transfers a small piece of Perl code to the remote host, and tries to
630 apply it for encoding and decoding.
632 The variable @var{tramp-inline-compress-start-size} controls, whether
633 a file shall be compressed before encoding. This could increase
634 transfer speed for large text files.
642 Connect to the remote host with @command{rsh}. Due to the unsecure
643 connection it is recommended for very local host topology only.
645 On operating systems which provide the command @command{remsh} instead
646 of @command{rsh}, you can use the method @option{remsh}. This is true
647 for HP-UX or Cray UNICOS, for example.
654 Connect to the remote host with @command{ssh}. This is identical to
655 the previous option except that the @command{ssh} package is used,
656 making the connection more secure.
658 All the methods based on @command{ssh} have an additional feature: you
659 can specify a host name which looks like @file{host#42} (the real host
660 name, then a hash sign, then a port number). This means to connect to
661 the given host but to also pass @code{-p 42} as arguments to the
662 @command{ssh} command.
665 @item @option{telnet}
666 @cindex method telnet
667 @cindex telnet method
669 Connect to the remote host with @command{telnet}. This is as unsecure
670 as the @option{rsh} method.
677 This method does not connect to a remote host at all, rather it uses
678 the @command{su} program to allow you to edit files as another user.
679 That means, the specified host name in the file name must be either
680 @samp{localhost} or the host name as returned by the function
681 @command{(system-name)}. For an exception of this rule see
689 This is similar to the @option{su} method, but it uses @command{sudo}
690 rather than @command{su} to become a different user.
692 Note that @command{sudo} must be configured to allow you to start a
693 shell as the user. It would be nice if it was sufficient if
694 @command{ls} and @command{mimencode} were allowed, but that is not
695 easy to implement, so I haven't got around to it, yet.
702 As you would expect, this is similar to @option{ssh}, only a little
703 different. Whereas @option{ssh} opens a normal interactive shell on
704 the remote host, this option uses @samp{ssh -t -t @var{host} -l
705 @var{user} /bin/sh} to open a connection. This is useful for users
706 where the normal login shell is set up to ask them a number of
707 questions when logging in. This procedure avoids these questions, and
708 just gives @value{tramp} a more-or-less `standard' login shell to work
711 Note that this procedure does not eliminate questions asked by
712 @command{ssh} itself. For example, @command{ssh} might ask ``Are you
713 sure you want to continue connecting?'' if the host key of the remote
714 host is not known. @value{tramp} does not know how to deal with such a
715 question (yet), therefore you will need to make sure that you can log
716 in without such questions.
718 This is also useful for Windows users where @command{ssh}, when
719 invoked from an @value{emacsname} buffer, tells them that it is not
720 allocating a pseudo tty. When this happens, the login shell is wont
721 to not print any shell prompt, which confuses @value{tramp} mightily.
723 This supports the @samp{-p} argument.
726 @item @option{krlogin}
727 @cindex method krlogin
728 @cindex krlogin method
729 @cindex Kerberos (with krlogin method)
731 This method is also similar to @option{ssh}. It only uses the
732 @command{krlogin -x} command to log in to the remote host.
738 @cindex Kerberos (with ksu method)
740 This is another method from the Kerberos suite. It behaves like @option{su}.
747 This method is mostly interesting for Windows users using the PuTTY
748 implementation of SSH@. It uses @samp{plink -ssh} to log in to the
751 This supports the @samp{-P} argument.
754 @item @option{plinkx}
755 @cindex method plinkx
756 @cindex plinkx method
758 Another method using PuTTY on Windows. Instead of host names, it
759 expects PuTTY session names, calling @samp{plink -load @var{session}
760 -t"}. User names are relevant only in case the corresponding session
761 hasn't defined a user name. Different port numbers must be defined in
767 @node External methods
768 @section External methods
769 @cindex methods, external
770 @cindex external methods
772 The external methods operate through multiple channels, using the
773 remote shell connection for many actions while delegating file
774 transfers to an external transfer utility.
776 This saves the overhead of encoding and decoding that multiplexing the
777 transfer through the one connection has with the inline methods.
779 Since external methods need their own overhead opening a new channel,
780 all files which are smaller than @var{tramp-copy-size-limit} are still
781 transferred with the corresponding inline method. It should provide a
782 fair trade-off between both approaches.
785 @item @option{rcp}---@command{rsh} and @command{rcp}
788 @cindex rcp (with rcp method)
789 @cindex rsh (with rcp method)
791 This method uses the @command{rsh} and @command{rcp} commands to connect
792 to the remote host and transfer files. This is probably the fastest
793 connection method available.
795 The alternative method @option{remcp} uses the @command{remsh} and
796 @command{rcp} commands. It should be applied on hosts where
797 @command{remsh} is used instead of @command{rsh}.
800 @item @option{scp}---@command{ssh} and @command{scp}
803 @cindex scp (with scp method)
804 @cindex ssh (with scp method)
806 Using @command{ssh} to connect to the remote host and @command{scp} to
807 transfer files between the hosts is the best method for securely
808 connecting to a remote host and accessing files.
810 The performance of this option is also quite good. It may be slower than
811 the inline methods when you often open and close small files however.
812 The cost of the cryptographic handshake at the start of an @command{scp}
813 session can begin to absorb the advantage that the lack of encoding and
816 All the @command{ssh} based methods support the @samp{-p} feature
817 where you can specify a port number to connect to in the host name.
818 For example, the host name @file{host#42} tells @value{tramp} to
819 specify @samp{-p 42} in the argument list for @command{ssh}, and to
820 specify @samp{-P 42} in the argument list for @command{scp}.
823 @item @option{sftp}---@command{ssh} and @command{sftp}
826 @cindex sftp (with sftp method)
827 @cindex ssh (with sftp method)
829 That is mostly the same method as @option{scp}, but using
830 @command{sftp} as transfer command. So the same remarks are valid.
832 This command does not work like @value{ftppackagename}, where
833 @command{ftp} is called interactively, and all commands are send from
834 within this session. Instead of, @command{ssh} is used for login.
836 This method supports the @samp{-p} argument.
839 @item @option{rsync}---@command{ssh} and @command{rsync}
842 @cindex rsync (with rsync method)
843 @cindex ssh (with rsync method)
845 Using the @command{ssh} command to connect securely to the remote
846 host and the @command{rsync} command to transfer files is almost
847 identical to the @option{scp} method.
849 While @command{rsync} performs much better than @command{scp} when
850 transferring files that exist on both hosts, this advantage is lost if
851 the file exists only on one side of the connection. A file can exists
852 on both the remote and local host, when you copy a file from/to a
853 remote host. When you just open a file from the remote host (or write
854 a file there), a temporary file on the local side is kept as long as
855 the corresponding buffer, visiting this file, is alive.
857 This method supports the @samp{-p} argument.
860 @item @option{scpx}---@command{ssh} and @command{scp}
863 @cindex scp (with scpx method)
864 @cindex ssh (with scpx method)
866 As you would expect, this is similar to @option{scp}, only a little
867 different. Whereas @option{scp} opens a normal interactive shell on
868 the remote host, this option uses @samp{ssh -t -t @var{host} -l
869 @var{user} /bin/sh} to open a connection. This is useful for users
870 where the normal login shell is set up to ask them a number of
871 questions when logging in. This procedure avoids these questions, and
872 just gives @value{tramp} a more-or-less `standard' login shell to work
875 This is also useful for Windows users where @command{ssh}, when
876 invoked from an @value{emacsname} buffer, tells them that it is not
877 allocating a pseudo tty. When this happens, the login shell is wont
878 to not print any shell prompt, which confuses @value{tramp} mightily.
880 This method supports the @samp{-p} argument.
883 @item @option{pscp}---@command{plink} and @command{pscp}
886 @cindex pscp (with pscp method)
887 @cindex plink (with pscp method)
888 @cindex PuTTY (with pscp method)
890 This method is similar to @option{scp}, but it uses the
891 @command{plink} command to connect to the remote host, and it uses
892 @command{pscp} for transferring the files. These programs are part
893 of PuTTY, an SSH implementation for Windows.
895 This method supports the @samp{-P} argument.
898 @item @option{psftp}---@command{plink} and @command{psftp}
901 @cindex psftp (with psftp method)
902 @cindex plink (with psftp method)
903 @cindex PuTTY (with psftp method)
905 As you would expect, this method is similar to @option{sftp}, but it
906 uses the @command{plink} command to connect to the remote host, and it
907 uses @command{psftp} for transferring the files. These programs are
908 part of PuTTY, an SSH implementation for Windows.
910 This method supports the @samp{-P} argument.
913 @item @option{fcp}---@command{fsh} and @command{fcp}
916 @cindex fsh (with fcp method)
917 @cindex fcp (with fcp method)
919 This method is similar to @option{scp}, but it uses the @command{fsh}
920 command to connect to the remote host, and it uses @command{fcp} for
921 transferring the files. @command{fsh/fcp} are a front-end for
922 @command{ssh} which allow for reusing the same @command{ssh} session
923 for submitting several commands. This avoids the startup overhead of
924 @command{scp} (which has to establish a secure connection whenever it
925 is called). Note, however, that you can also use one of the inline
926 methods to achieve a similar effect.
928 This method uses the command @samp{fsh @var{host} -l @var{user}
929 /bin/sh -i} to establish the connection, it does not work to just say
930 @command{fsh @var{host} -l @var{user}}.
935 There is no inline method using @command{fsh} as the multiplexing
936 provided by the program is not very useful in our context. @value{tramp}
937 opens just one connection to the remote host and then keeps it open,
945 This is not a native @value{tramp} method. Instead, it forwards all
946 requests to @value{ftppackagename}.
948 This works only for unified file names, see @ref{Issues}.
952 @item @option{smb}---@command{smbclient}
956 This is another not native @value{tramp} method. It uses the
957 @command{smbclient} command on different Unices in order to connect to
958 an SMB server. An SMB server might be a Samba (or CIFS) server on
959 another UNIX host or, more interesting, a host running MS Windows. So
960 far, it is tested against MS Windows NT, MS Windows 2000, MS Windows
961 XP, MS Windows Vista, and MS Windows 7.
963 The first directory in the localname must be a share name on the remote
964 host. Remember that the @code{$} character, in which default shares
965 usually end, must be written @code{$$} due to environment variable
966 substitution in file names. If no share name is given (i.e., remote
967 directory @code{/}), all available shares are listed.
969 Since authorization is done on share level, you will always be
970 prompted for a password if you access another share on the same host.
971 This can be suppressed by @ref{Password handling}.
973 For authorization, MS Windows uses both a user name and a domain name.
974 Because of this, the @value{tramp} syntax has been extended: you can
975 specify a user name which looks like @code{user%domain} (the real user
976 name, then a percent sign, then the domain name). So, to connect to
977 the host @code{melancholia} as user @code{daniel} of the domain
978 @code{BIZARRE}, and edit @file{.emacs} in the home directory (share
979 @code{daniel$}) I would specify the file name @file{@trampfn{smb,
980 daniel%BIZARRE, melancholia, /daniel$$/.emacs}}.
982 Depending on the Windows domain configuration, a Windows user might be
983 considered as domain user per default. In order to connect as local
984 user, the WINS name of that host must be given as domain name.
985 Usually, it is the host name in capital letters. In the example
986 above, the local user @code{daniel} would be specified as
987 @file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}.
989 The domain name as well as the user name are optional. If no user
990 name is specified at all, the anonymous user (without password
991 prompting) is assumed. This is different from all other @value{tramp}
992 methods, where in such a case the local user name is taken.
994 The @option{smb} method supports the @samp{-p} argument.
996 @strong{Please note:} If @value{emacsname} runs locally under MS
997 Windows, this method isn't available. Instead, you can use UNC
998 file names like @file{//melancholia/daniel$$/.emacs}. The only
999 disadvantage is that there's no possibility to specify another user
1007 This special method uses the Android Debug Bridge for accessing
1008 Android devices. The Android Debug Bridge must be installed locally.
1009 Some GNU/Linux distributions offer it for installation, otherwise it
1010 can be installed as part of the Android SDK. If the @command{adb}
1011 program is not found via the @env{PATH} environment variable, the
1012 variable @var{tramp-adb-program} must point to its absolute path.
1014 Tramp does not connect Android devices to @command{adb}. This must be
1015 performed outside @value{emacsname}. If there is exactly one Android
1016 device connected to @command{adb}, a host name is not needed in the
1017 remote file name. The default @value{tramp} name to be used is
1018 @file{@trampfn{adb, , ,}} therefore. Otherwise, one could find
1019 potential host names with the command @command{adb devices}.
1021 Usually, the @command{adb} method does not need any user name. It
1022 runs under the permissions of the @command{adbd} process on the
1023 Android device. If a user name is specified, @value{tramp} applies an
1024 @command{su} on the device. This does not work with all Android
1025 devices, especially with unrooted ones. In that case, an error
1026 message is displayed.
1032 @node GVFS based methods
1033 @section GVFS based external methods
1034 @cindex methods, gvfs
1035 @cindex gvfs based methods
1038 The connection methods described in this section are based on GVFS
1039 @uref{http://en.wikipedia.org/wiki/GVFS}. Via GVFS, the remote
1040 filesystem is mounted locally through FUSE@. @value{tramp} uses
1041 this local mounted directory internally.
1043 The communication with GVFS is implemented via D-Bus messages.
1044 Therefore, your @value{emacsname} must have D-Bus integration,
1045 @pxref{Top, , D-Bus, dbus}.
1054 This method provides access to WebDAV files and directories. There
1055 exists also the external method @option{davs}, which uses SSL
1056 encryption for the access.
1058 Both methods support the port number specification as discussed above.
1065 OBEX is an FTP-like access protocol for simple devices, like cell
1066 phones. For the time being, @value{tramp} only supports OBEX over Bluetooth.
1069 @item @option{synce}
1070 @cindex method synce
1071 @cindex synce method
1073 The @option{synce} method allows communication with Windows Mobile
1074 devices. Beside GVFS for mounting remote files and directories via
1075 FUSE, it also needs the SYNCE-GVFS plugin.
1079 @defopt tramp-gvfs-methods
1080 This customer option, a list, defines the external methods which
1081 shall be used with GVFS@. Per default, these are @option{dav},
1082 @option{davs}, @option{obex} and @option{synce}. Other possible
1083 values are @option{ftp}, @option{sftp} and @option{smb}.
1089 @node Gateway methods
1090 @section Gateway methods
1091 @cindex methods, gateway
1092 @cindex gateway methods
1094 Gateway methods are not methods to access a remote host directly.
1095 These methods are intended to pass firewalls or proxy servers.
1096 Therefore, they can be used for proxy host declarations
1097 (@pxref{Multi-hops}) only.
1099 A gateway method must always come along with a method which supports
1100 port setting. This is because @value{tramp} targets the accompanied
1101 method to @file{localhost#random_port}, from where the firewall or
1102 proxy server is accessed.
1104 Gateway methods support user name and password declarations. These
1105 are used to authenticate towards the corresponding firewall or proxy
1106 server. They can be passed only if your friendly administrator has
1107 granted your access.
1110 @item @option{tunnel}
1111 @cindex method tunnel
1112 @cindex tunnel method
1114 This method implements an HTTP tunnel via the @command{CONNECT}
1115 command (see RFC 2616, 2817). Any HTTP 1.1 compliant (proxy) server
1116 shall support this command.
1118 As authentication method, only @option{Basic Authentication} (see RFC
1119 2617) is implemented so far. If no port number is given in the
1120 declaration, port @option{8080} is used for the proxy server.
1123 @item @option{socks}
1124 @cindex method socks
1125 @cindex socks method
1127 The @command{socks} method provides access to SOCKSv5 servers (see
1128 RFC 1928). @option{Username/Password Authentication} according to RFC
1131 The default port number of the socks server is @option{1080}, if not
1132 specified otherwise.
1138 @node Default Method
1139 @section Selecting a default method
1140 @cindex default method
1142 @vindex tramp-default-method
1143 When you select an appropriate transfer method for your typical usage
1144 you should set the variable @code{tramp-default-method} to reflect that
1145 choice. This variable controls which method will be used when a method
1146 is not specified in the @value{tramp} file name. For example:
1149 (setq tramp-default-method "ssh")
1152 @vindex tramp-default-method-alist
1153 You can also specify different methods for certain user/host
1154 combinations, via the variable @code{tramp-default-method-alist}. For
1155 example, the following two lines specify to use the @option{ssh}
1156 method for all user names matching @samp{john} and the @option{rsync}
1157 method for all host names matching @samp{lily}. The third line
1158 specifies to use the @option{su} method for the user @samp{root} on
1159 the host @samp{localhost}.
1162 (add-to-list 'tramp-default-method-alist '("" "john" "ssh"))
1163 (add-to-list 'tramp-default-method-alist '("lily" "" "rsync"))
1164 (add-to-list 'tramp-default-method-alist
1165 '("\\`localhost\\'" "\\`root\\'" "su"))
1169 See the documentation for the variable
1170 @code{tramp-default-method-alist} for more details.
1172 External methods are normally preferable to inline methods, giving
1175 @xref{Inline methods}.
1176 @xref{External methods}.
1178 Another consideration with the selection of transfer methods is the
1179 environment you will use them in and, especially when used over the
1180 Internet, the security implications of your preferred method.
1182 The @option{rsh} and @option{telnet} methods send your password as
1183 plain text as you log in to the remote host, as well as
1184 transferring the files in such a way that the content can easily be
1185 read from other hosts.
1187 If you need to connect to remote systems that are accessible from the
1188 Internet, you should give serious thought to using @option{ssh} based
1189 methods to connect. These provide a much higher level of security,
1190 making it a non-trivial exercise for someone to obtain your password
1191 or read the content of the files you are editing.
1194 @subsection Which method is the right one for me?
1195 @cindex choosing the right method
1197 Given all of the above, you are probably thinking that this is all fine
1198 and good, but it's not helping you to choose a method! Right you are.
1199 As a developer, we don't want to boss our users around but give them
1200 maximum freedom instead. However, the reality is that some users would
1201 like to have some guidance, so here I'll try to give you this guidance
1202 without bossing you around. You tell me whether it works @dots{}
1204 My suggestion is to use an inline method. For large files, external
1205 methods might be more efficient, but I guess that most people will
1206 want to edit mostly small files. And if you access large text files,
1207 compression (driven by @var{tramp-inline-compress-start-size}) shall
1208 still result in good performance.
1210 I guess that these days, most people can access a remote host by
1211 using @command{ssh}. So I suggest that you use the @option{ssh}
1212 method. So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost,
1213 /etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other
1216 If you can't use @option{ssh} to log in to the remote host, then
1217 select a method that uses a program that works. For instance, Windows
1218 users might like the @option{plink} method which uses the PuTTY
1219 implementation of @command{ssh}. Or you use Kerberos and thus like
1222 For the special case of editing files on the local host as another
1223 user, see the @option{su} or @option{sudo} methods. They offer
1224 shortened syntax for the @samp{root} account, like
1225 @file{@trampfn{su, , , /etc/motd}}.
1227 People who edit large files may want to consider @option{scp} instead
1228 of @option{ssh}, or @option{pscp} instead of @option{plink}. These
1229 external methods are faster than inline methods for large files.
1230 Note, however, that external methods suffer from some limitations.
1231 Please try first whether you really get a noticeable speed advantage
1232 from using an external method! Maybe even for large files, inline
1233 methods are fast enough.
1237 @section Selecting a default user
1238 @cindex default user
1240 The user part of a @value{tramp} file name can be omitted. Usually,
1241 it is replaced by the user name you are logged in. Often, this is not
1242 what you want. A typical use of @value{tramp} might be to edit some
1243 files with root permissions on the local host. This case, you should
1244 set the variable @code{tramp-default-user} to reflect that choice.
1248 (setq tramp-default-user "root")
1251 @code{tramp-default-user} is regarded as obsolete, and will be removed
1254 @vindex tramp-default-user-alist
1255 You can also specify different users for certain method/host
1256 combinations, via the variable @code{tramp-default-user-alist}. For
1257 example, if you always have to use the user @samp{john} in the domain
1258 @samp{somewhere.else}, you can specify the following:
1261 (add-to-list 'tramp-default-user-alist
1262 '("ssh" ".*\\.somewhere\\.else\\'" "john"))
1266 See the documentation for the variable @code{tramp-default-user-alist}
1269 One trap to fall in must be known. If @value{tramp} finds a default
1270 user, this user will be passed always to the connection command as
1271 parameter (for example @command{ssh here.somewhere.else -l john}. If
1272 you have specified another user for your command in its configuration
1273 files, @value{tramp} cannot know it, and the remote access will fail.
1274 If you have specified in the given example in @file{~/.ssh/config} the
1278 Host here.somewhere.else
1283 than you must discard selecting a default user by @value{tramp}. This
1284 will be done by setting it to @code{nil} (or @samp{lily}, likewise):
1287 (add-to-list 'tramp-default-user-alist
1288 '("ssh" "\\`here\\.somewhere\\.else\\'" nil))
1291 The last entry in @code{tramp-default-user-alist} could be your
1292 default user you'll apply predominantly. You shall @emph{append} it
1293 to that list at the end:
1296 (add-to-list 'tramp-default-user-alist '(nil nil "jonas") t)
1301 @section Selecting a default host
1302 @cindex default host
1304 @vindex tramp-default-host
1305 Finally, it is even possible to omit the host name part of a
1306 @value{tramp} file name. This case, the value of the variable
1307 @code{tramp-default-host} is used. Per default, it is initialized
1308 with the host name your local @value{emacsname} is running.
1310 If you, for example, use @value{tramp} mainly to contact the host
1311 @samp{target} as user @samp{john}, you can specify:
1314 (setq tramp-default-user "john"
1315 tramp-default-host "target")
1318 Then the simple file name @samp{@trampfn{ssh, , ,}} will connect you
1319 to John's home directory on target.
1321 Note, however, that the most simplification @samp{/::} won't work,
1322 because @samp{/:} is the prefix for quoted file names.
1325 @vindex tramp-default-host-alist
1326 Like with methods and users, you can also specify different default
1327 hosts for certain method/user combinations via the variable
1328 @code{tramp-default-host-alist}. Usually, this isn't necessary,
1329 because @code{tramp-default-host} should be sufficient. For some
1330 methods, like @option{adb}, that default value must be overwritten,
1331 which is already the initial value of @code{tramp-default-host-alist}.
1334 See the documentation for the variable @code{tramp-default-host-alist}
1339 @section Connecting to a remote host using multiple hops
1343 Sometimes, the methods described before are not sufficient.
1344 Sometimes, it is not possible to connect to a remote host using a
1345 simple command. For example, if you are in a secured network, you
1346 might have to log in to a bastion host first before you can connect to
1347 the outside world. Of course, the target host may also require a
1350 @vindex tramp-default-proxies-alist
1351 @defopt tramp-default-proxies-alist
1352 In order to specify multiple hops, it is possible to define a proxy
1353 host to pass through, via the variable
1354 @code{tramp-default-proxies-alist}. This variable keeps a list of
1355 triples (@var{host} @var{user} @var{proxy}).
1357 The first matching item specifies the proxy host to be passed for a
1358 file name located on a remote target matching @var{user}@@@var{host}.
1359 @var{host} and @var{user} are regular expressions or @code{nil}, which
1360 is interpreted as a regular expression which always matches.
1362 @var{proxy} must be a Tramp file name which localname part is ignored.
1363 Method and user name on @var{proxy} are optional, which is interpreted
1364 with the default values.
1366 The method must be an inline or gateway method (@pxref{Inline
1367 methods}, @pxref{Gateway methods}).
1370 The method must be an inline method (@pxref{Inline methods}).
1372 If @var{proxy} is @code{nil}, no additional hop is required reaching
1373 @var{user}@@@var{host}.
1375 If you, for example, must pass the host @samp{bastion.your.domain} as
1376 user @samp{bird} for any remote host which is not located in your local
1380 (add-to-list 'tramp-default-proxies-alist
1381 '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}"))
1382 (add-to-list 'tramp-default-proxies-alist
1383 '("\\.your\\.domain\\'" nil nil))
1386 Please note the order of the code. @code{add-to-list} adds elements at the
1387 beginning of a list. Therefore, most relevant rules must be added last.
1389 Proxy hosts can be cascaded. If there is another host called
1390 @samp{jump.your.domain}, which is the only one in your local domain who
1391 is allowed connecting @samp{bastion.your.domain}, you can add another
1395 (add-to-list 'tramp-default-proxies-alist
1396 '("\\`bastion\\.your\\.domain\\'"
1398 "@trampfn{ssh, , jump.your.domain,}"))
1401 @var{proxy} can contain the patterns @code{%h} or @code{%u}. These
1402 patterns are replaced by the strings matching @var{host} or
1403 @var{user}, respectively.
1405 If you, for example, wants to work as @samp{root} on hosts in the
1406 domain @samp{your.domain}, but login as @samp{root} is disabled for
1407 non-local access, you might add the following rule:
1410 (add-to-list 'tramp-default-proxies-alist
1411 '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}"))
1414 Opening @file{@trampfn{sudo, , randomhost.your.domain,}} would connect
1415 first @samp{randomhost.your.domain} via @code{ssh} under your account
1416 name, and perform @code{sudo -u root} on that host afterwards. It is
1417 important to know that the given method is applied on the host which
1418 has been reached so far. @code{sudo -u root}, applied on your local
1419 host, wouldn't be useful here.
1421 @var{host}, @var{user} and @var{proxy} can also be Lisp forms. These
1422 forms are evaluated, and must return a string, or @code{nil}. The
1423 previous example could be generalized then: For all hosts except my
1424 local one connect via @command{ssh} first, and apply @command{sudo -u
1428 (add-to-list 'tramp-default-proxies-alist
1429 '(nil "\\`root\\'" "@trampfn{ssh, , %h,}"))
1430 (add-to-list 'tramp-default-proxies-alist
1431 '((regexp-quote (system-name)) nil nil))
1434 This is the recommended configuration to work as @samp{root} on remote
1438 Finally, @code{tramp-default-proxies-alist} can be used to pass
1439 firewalls or proxy servers. Imagine your local network has a host
1440 @samp{proxy.your.domain} which is used on port 3128 as HTTP proxy to
1441 the outer world. Your friendly administrator has granted you access
1442 under your user name to @samp{host.other.domain} on that proxy
1443 server.@footnote{HTTP tunnels are intended for secure SSL/TLS
1444 communication. Therefore, many proxy server restrict the tunnels to
1445 related target ports. You might need to run your ssh server on your
1446 target host @samp{host.other.domain} on such a port, like 443 (https).
1447 See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall}
1448 for discussion of ethical issues.} You would need to add the
1452 (add-to-list 'tramp-default-proxies-alist
1453 '("\\`host\\.other\\.domain\\'" nil
1454 "@trampfn{tunnel, , proxy.your.domain#3128,}"))
1457 Gateway methods can be declared as first hop only in a multiple hop
1462 Hops to be passed tend to be restricted firewalls and alike.
1463 Sometimes they offer limited features only, like running @command{rbash}
1464 (restricted bash). This must be told to @value{tramp}.
1466 @vindex tramp-restricted-shell-hosts-alist
1467 @defopt tramp-restricted-shell-hosts-alist
1468 This variable keeps a list of regular expressions, which denote hosts
1469 running a registered shell like "rbash". Those hosts can be used as
1472 If the bastion host from the example above runs a restricted shell,
1476 (add-to-list 'tramp-restricted-shell-hosts-alist
1477 "\\`bastion\\.your\\.domain\\'")
1482 @node Customizing Methods
1483 @section Using Non-Standard Methods
1484 @cindex customizing methods
1485 @cindex using non-standard methods
1486 @cindex create your own methods
1488 There is a variable @code{tramp-methods} which you can change if the
1489 predefined methods don't seem right.
1491 For the time being, I'll refer you to the Lisp documentation of that
1492 variable, accessible with @kbd{C-h v tramp-methods @key{RET}}.
1495 @node Customizing Completion
1496 @section Selecting config files for user/host name completion
1497 @cindex customizing completion
1498 @cindex selecting config files
1499 @vindex tramp-completion-function-alist
1501 The variable @code{tramp-completion-function-alist} is intended to
1502 customize which files are taken into account for user and host name
1503 completion (@pxref{File name completion}). For every method, it keeps
1504 a set of configuration files, accompanied by a Lisp function able to
1505 parse that file. Entries in @code{tramp-completion-function-alist}
1506 have the form (@var{method} @var{pair1} @var{pair2} ...).
1508 Each @var{pair} is composed of (@var{function} @var{file}).
1509 @var{function} is responsible to extract user names and host names
1510 from @var{file} for completion. There are two functions which access
1513 @defun tramp-get-completion-function method
1514 This function returns the list of completion functions for @var{method}.
1518 (tramp-get-completion-function "rsh")
1520 @result{} ((tramp-parse-rhosts "/etc/hosts.equiv")
1521 (tramp-parse-rhosts "~/.rhosts"))
1525 @defun tramp-set-completion-function method function-list
1526 This function sets @var{function-list} as list of completion functions
1531 (tramp-set-completion-function "ssh"
1532 '((tramp-parse-sconfig "/etc/ssh_config")
1533 (tramp-parse-sconfig "~/.ssh/config")))
1535 @result{} ((tramp-parse-sconfig "/etc/ssh_config")
1536 (tramp-parse-sconfig "~/.ssh/config"))
1540 The following predefined functions parsing configuration files exist:
1543 @item @code{tramp-parse-rhosts}
1544 @findex tramp-parse-rhosts
1546 This function parses files which are syntactical equivalent to
1547 @file{~/.rhosts}. It returns both host names and user names, if
1550 @item @code{tramp-parse-shosts}
1551 @findex tramp-parse-shosts
1553 This function parses files which are syntactical equivalent to
1554 @file{~/.ssh/known_hosts}. Since there are no user names specified
1555 in such files, it can return host names only.
1557 @item @code{tramp-parse-sconfig}
1558 @findex tramp-parse-shosts
1560 This function returns the host nicknames defined by @code{Host} entries
1561 in @file{~/.ssh/config} style files.
1563 @item @code{tramp-parse-shostkeys}
1564 @findex tramp-parse-shostkeys
1566 SSH2 parsing of directories @file{/etc/ssh2/hostkeys/*} and
1567 @file{~/ssh2/hostkeys/*}. Hosts are coded in file names
1568 @file{hostkey_@var{portnumber}_@var{host-name}.pub}. User names
1569 are always @code{nil}.
1571 @item @code{tramp-parse-sknownhosts}
1572 @findex tramp-parse-shostkeys
1574 Another SSH2 style parsing of directories like
1575 @file{/etc/ssh2/knownhosts/*} and @file{~/ssh2/knownhosts/*}. This
1576 case, hosts names are coded in file names
1577 @file{@var{host-name}.@var{algorithm}.pub}. User names are always @code{nil}.
1579 @item @code{tramp-parse-hosts}
1580 @findex tramp-parse-hosts
1582 A function dedicated to @file{/etc/hosts} style files. It returns
1585 @item @code{tramp-parse-passwd}
1586 @findex tramp-parse-passwd
1588 A function which parses @file{/etc/passwd} like files. Obviously, it
1589 can return user names only.
1591 @item @code{tramp-parse-netrc}
1592 @findex tramp-parse-netrc
1594 Finally, a function which parses @file{~/.netrc} like files. This
1595 includes also @file{~/.authinfo}-style files.
1599 If you want to keep your own data in a file, with your own structure,
1600 you might provide such a function as well. This function must meet
1601 the following conventions:
1603 @defun my-tramp-parse file
1604 @var{file} must be either a file name on your host, or @code{nil}.
1605 The function must return a list of (@var{user} @var{host}), which are
1606 taken as candidates for user and host name completion.
1610 (my-tramp-parse "~/.my-tramp-hosts")
1612 @result{} ((nil "toto") ("daniel" "melancholia"))
1617 @node Password handling
1618 @section Reusing passwords for several connections
1621 Sometimes it is necessary to connect to the same remote host several
1622 times. Reentering passwords again and again would be annoying, when
1623 the chosen method does not support access without password prompt
1624 through own configuration.
1626 The best recommendation is to use the method's own mechanism for
1627 password handling. Consider @command{ssh-agent} for @option{ssh}-like
1628 methods, or @command{pageant} for @option{plink}-like methods.
1630 However, if you cannot apply such native password handling,
1631 @value{tramp} offers alternatives.
1634 @anchor{Using an authentication file}
1635 @subsection Using an authentication file
1637 @vindex auth-sources
1638 The package @file{auth-source.el}, originally developed in No Gnus,
1639 offers the possibility to read passwords from a file, like FTP does it
1640 from @file{~/.netrc}. The default authentication file is
1641 @file{~/.authinfo.gpg}, this can be changed via the variable
1642 @code{auth-sources}.
1645 A typical entry in the authentication file would be
1648 machine melancholia port scp login daniel password geheim
1651 The port can be any @value{tramp} method (@pxref{Inline methods},
1652 @pxref{External methods}), to match only this method. When you omit
1653 the port, you match all @value{tramp} methods.
1655 In case of problems, setting @code{auth-source-debug} to @code{t}
1656 gives useful debug messages.
1659 @anchor{Caching passwords}
1660 @subsection Caching passwords
1662 If there is no authentication file, @value{tramp} caches the passwords
1663 entered by you. They will be reused next time if a connection needs
1664 them for the same user name and host name, independently of the
1667 @vindex password-cache-expiry
1668 Passwords are not saved permanently, that means the password caching
1669 is limited to the lifetime of your @value{emacsname} session. You
1670 can influence the lifetime of password caching by customizing the
1671 variable @code{password-cache-expiry}. The value is the number of
1672 seconds how long passwords are cached. Setting it to @code{nil}
1673 disables the expiration.
1675 @vindex password-cache
1676 If you don't like this feature for security reasons, password caching
1677 can be disabled totally by customizing the variable
1678 @code{password-cache} (setting it to @code{nil}).
1680 Implementation Note: password caching is based on the package
1681 @file{password-cache.el}. For the time being, it is activated only
1682 when this package is seen in the @code{load-path} while loading
1684 @ifset installchapter
1685 If you don't use No Gnus, you can take @file{password.el} from the
1686 @value{tramp} @file{contrib} directory, see @ref{Installation
1691 @node Connection caching
1692 @section Reusing connection related information
1695 @vindex tramp-persistency-file-name
1696 In order to reduce initial connection time, @value{tramp} stores
1697 connection related information persistently. The variable
1698 @code{tramp-persistency-file-name} keeps the file name where these
1699 information are written. Its default value is
1701 @file{~/.emacs.d/tramp}.
1704 @file{~/.xemacs/tramp}.
1706 It is recommended to choose a local file name.
1708 @value{tramp} reads this file during startup, and writes it when
1709 exiting @value{emacsname}. You can simply remove this file if
1710 @value{tramp} shall be urged to recompute these information next
1711 @value{emacsname} startup time.
1713 Using such persistent information can be disabled by setting
1714 @code{tramp-persistency-file-name} to @code{nil}.
1716 Once consequence of reusing connection related information is that
1717 @var{tramp} needs to distinguish hosts. If you, for example, run a
1718 local @code{sshd} on port 3001, which tunnels @command{ssh} to another
1719 host, you could access both @file{@trampfn{ssh, , localhost,}} and
1720 @file{@trampfn{ssh, , localhost#3001,}}. @var{tramp} would use the
1721 same host related information (like paths, Perl variants, etc) for
1722 both connections, although the information is valid only for one of
1725 In order to avoid trouble, you must use another host name for one of
1726 the connections, like introducing a @option{Host} section in
1727 @file{~/.ssh/config} (@pxref{Frequently Asked Questions}) or applying
1728 multiple hops (@pxref{Multi-hops}).
1730 When @value{tramp} detects a changed operating system version on a
1731 remote host (via the command @command{uname -sr}), it flushes all
1732 connection related information for this host, and opens the
1736 @node Predefined connection information
1737 @section Setting own connection related information
1739 Sometimes, @var{tramp} is not able to detect correct connection
1740 related information. In such cases, you could tell @var{tramp} which
1741 value it has to take. Since this could result in errors, it has to be
1744 @vindex tramp-connection-properties
1745 Such settings can be performed via the list
1746 @code{tramp-connection-properties}. An entry in this list has the
1747 form @code{(@var{regexp} @var{property} @var{value})}. @var{regexp}
1748 matches remote file names for which a property shall be predefined.
1749 It can be @code{nil}. @var{property} is a string, and @var{value} the
1750 corresponding value. @var{property} could be any property found in
1751 the file @code{tramp-persistency-file-name}.
1753 A special property is @code{"busybox"}. This must be set, if the
1754 remote host runs a very restricted busybox as shell, which closes the
1755 connection at will. Since there is no reliable test for this,
1756 @var{tramp} must be indicated this way. Example:
1759 (add-to-list 'tramp-connection-properties
1760 (list (regexp-quote "@trampfn{ssh, user, randomhost.your.domain,}")
1765 @node Remote Programs
1766 @section How @value{tramp} finds and uses programs on the remote host
1768 @value{tramp} depends on a number of programs on the remote host in order to
1769 function, including @command{ls}, @command{test}, @command{find} and
1772 In addition to these required tools, there are various tools that may be
1773 required based on the connection method. See @ref{Inline methods} and
1774 @ref{External methods} for details on these.
1776 Certain other tools, such as @command{perl} (or @command{perl5}) and
1777 @command{grep} will be used if they can be found. When they are
1778 available, they are used to improve the performance and accuracy of
1781 @vindex tramp-remote-path
1782 @vindex tramp-default-remote-path
1783 @vindex tramp-own-remote-path
1784 @defopt tramp-remote-path
1785 When @value{tramp} connects to the remote host, it searches for the
1786 programs that it can use. The variable @code{tramp-remote-path}
1787 controls the directories searched on the remote host.
1789 By default, this is set to a reasonable set of defaults for most
1790 hosts. The symbol @code{tramp-default-remote-path} is a place
1791 holder, it is replaced by the list of directories received via the
1792 command @command{getconf PATH} on your remote host. For example,
1793 on Debian GNU/Linux this is @file{/bin:/usr/bin}, whereas on Solaris
1794 this is @file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}.
1795 It is recommended to apply this symbol on top of
1796 @code{tramp-remote-path}.
1798 It is possible, however, that your local (or remote ;) system
1799 administrator has put the tools you want in some obscure local
1802 In this case, you can still use them with @value{tramp}. You simply
1803 need to add code to your @file{.emacs} to add the directory to the
1804 remote path. This will then be searched by @value{tramp} when you
1805 connect and the software found.
1807 To add a directory to the remote search path, you could use code such
1811 @i{;; We load @value{tramp} to define the variable.}
1813 @i{;; We have @command{perl} in "/usr/local/perl/bin"}
1814 (add-to-list 'tramp-remote-path "/usr/local/perl/bin")
1817 Another possibility is to reuse the path settings of your remote
1818 account when you log in. Usually, these settings are overwritten,
1819 because they might not be useful for @value{tramp}. The place holder
1820 @code{tramp-own-remote-path} preserves these settings. You can
1824 (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
1828 @value{tramp} caches several information, like the Perl binary
1829 location. The changed remote search path wouldn't affect these
1830 settings. In order to force @value{tramp} to recompute these values,
1831 you must exit @value{emacsname}, remove your persistency file
1832 (@pxref{Connection caching}), and restart @value{emacsname}.
1835 @node Remote shell setup
1836 @section Remote shell setup hints
1837 @cindex remote shell setup
1838 @cindex @file{.profile} file
1839 @cindex @file{.login} file
1840 @cindex shell init files
1842 As explained in the @ref{Overview} section, @value{tramp} connects to the
1843 remote host and talks to the shell it finds there. Of course, when you
1844 log in, the shell executes its init files. Suppose your init file
1845 requires you to enter the birth date of your mother; clearly @value{tramp}
1846 does not know this and hence fails to log you in to that host.
1848 There are different possible strategies for pursuing this problem. One
1849 strategy is to enable @value{tramp} to deal with all possible situations.
1850 This is a losing battle, since it is not possible to deal with
1851 @emph{all} situations. The other strategy is to require you to set up
1852 the remote host such that it behaves like @value{tramp} expects. This might
1853 be inconvenient because you have to invest a lot of effort into shell
1854 setup before you can begin to use @value{tramp}.
1856 The package, therefore, pursues a combined approach. It tries to
1857 figure out some of the more common setups, and only requires you to
1858 avoid really exotic stuff. For example, it looks through a list of
1859 directories to find some programs on the remote host. And also, it
1860 knows that it is not obvious how to check whether a file exists, and
1861 therefore it tries different possibilities. (On some hosts and
1862 shells, the command @command{test -e} does the trick, on some hosts
1863 the shell builtin doesn't work but the program @command{/usr/bin/test
1864 -e} or @command{/bin/test -e} works. And on still other hosts,
1865 @command{ls -d} is the right way to do this.)
1867 Below you find a discussion of a few things that @value{tramp} does not deal
1868 with, and that you therefore have to set up correctly.
1871 @item @var{shell-prompt-pattern}
1872 @vindex shell-prompt-pattern
1874 After logging in to the remote host, @value{tramp} has to wait for the remote
1875 shell startup to finish before it can send commands to the remote
1876 shell. The strategy here is to wait for the shell prompt. In order to
1877 recognize the shell prompt, the variable @code{shell-prompt-pattern} has
1878 to be set correctly to recognize the shell prompt on the remote host.
1880 Note that @value{tramp} requires the match for @code{shell-prompt-pattern}
1881 to be at the end of the buffer. Many people have something like the
1882 following as the value for the variable: @code{"^[^>$][>$] *"}. Now
1883 suppose your shell prompt is @code{a <b> c $ }. In this case,
1884 @value{tramp} recognizes the @code{>} character as the end of the prompt,
1885 but it is not at the end of the buffer.
1887 @item @var{tramp-shell-prompt-pattern}
1888 @vindex tramp-shell-prompt-pattern
1890 This regular expression is used by @value{tramp} in the same way as
1891 @code{shell-prompt-pattern}, to match prompts from the remote shell.
1892 This second variable exists because the prompt from the remote shell
1893 might be different from the prompt from a local shell---after all,
1894 the whole point of @value{tramp} is to log in to remote hosts as a
1895 different user. The default value of
1896 @code{tramp-shell-prompt-pattern} is the same as the default value of
1897 @code{shell-prompt-pattern}, which is reported to work well in many
1900 @item @var{tramp-password-prompt-regexp}
1901 @vindex tramp-password-prompt-regexp
1902 @vindex tramp-wrong-passwd-regexp
1904 During login, @value{tramp} might be forced to enter a password or a
1905 passphrase. The difference between both is that a password is
1906 requested from the shell on the remote host, while a passphrase is
1907 needed for accessing local authentication information, like your ssh
1910 @var{tramp-password-prompt-regexp} handles the detection of such
1911 requests for English environments. When you use another localization
1912 of your (local or remote) host, you might need to adapt this. Example:
1916 tramp-password-prompt-regexp
1920 '("passphrase" "Passphrase"
1922 "password" "Password"
1924 "passwort" "Passwort"
1926 "mot de passe" "Mot de passe") t)
1930 In parallel, it might also be necessary to adapt
1931 @var{tramp-wrong-passwd-regexp}.
1933 @item @command{tset} and other questions
1934 @cindex Unix command tset
1935 @cindex tset Unix command
1937 Some people invoke the @command{tset} program from their shell startup
1938 scripts which asks the user about the terminal type of the shell.
1939 Maybe some shells ask other questions when they are started.
1940 @value{tramp} does not know how to answer these questions. There are
1941 two approaches for dealing with this problem. One approach is to take
1942 care that the shell does not ask any questions when invoked from
1943 @value{tramp}. You can do this by checking the @env{TERM}
1944 environment variable, it will be set to @code{dumb} when connecting.
1946 @vindex tramp-terminal-type
1947 The variable @code{tramp-terminal-type} can be used to change this value
1950 @vindex tramp-actions-before-shell
1951 The other approach is to teach @value{tramp} about these questions. See
1952 the variable @code{tramp-actions-before-shell}. Example:
1955 (defconst my-tramp-prompt-regexp
1956 (concat (regexp-opt '("Enter the birth date of your mother:") t)
1958 "Regular expression matching my login prompt question.")
1960 (defun my-tramp-action (proc vec)
1961 "Enter \"19000101\" in order to give a correct answer."
1962 (save-window-excursion
1963 (with-current-buffer (tramp-get-connection-buffer vec)
1964 (tramp-message vec 6 "\n%s" (buffer-string))
1965 (tramp-send-string vec "19000101"))))
1967 (add-to-list 'tramp-actions-before-shell
1968 '(my-tramp-prompt-regexp my-tramp-action))
1972 @item Environment variables named like users in @file{.profile}
1974 If you have a user named frumple and set the variable @env{FRUMPLE} in
1975 your shell environment, then this might cause trouble. Maybe rename
1976 the variable to @env{FRUMPLE_DIR} or the like.
1978 This weird effect was actually reported by a @value{tramp} user!
1981 @item Non-Bourne commands in @file{.profile}
1983 After logging in to the remote host, @value{tramp} issues the command
1984 @command{exec /bin/sh}. (Actually, the command is slightly
1985 different.) When @command{/bin/sh} is executed, it reads some init
1986 files, such as @file{~/.shrc} or @file{~/.profile}.
1988 Now, some people have a login shell which is not @code{/bin/sh} but a
1989 Bourne-ish shell such as bash or ksh. Some of these people might put
1990 their shell setup into the files @file{~/.shrc} or @file{~/.profile}.
1991 This way, it is possible for non-Bourne constructs to end up in those
1992 files. Then, @command{exec /bin/sh} might cause the Bourne shell to
1993 barf on those constructs.
1995 As an example, imagine somebody putting @command{export FOO=bar} into
1996 the file @file{~/.profile}. The standard Bourne shell does not
1997 understand this syntax and will emit a syntax error when it reaches
2000 Another example is the tilde (@code{~}) character, say when adding
2001 @file{~/bin} to @env{PATH}. Many Bourne shells will not expand this
2002 character, and since there is usually no directory whose name consists
2003 of the single character tilde, strange things will happen.
2005 What can you do about this?
2007 Well, one possibility is to make sure that everything in
2008 @file{~/.shrc} and @file{~/.profile} on all remote hosts is
2009 Bourne-compatible. In the above example, instead of @command{export
2010 FOO=bar}, you might use @command{FOO=bar; export FOO} instead.
2012 The other possibility is to put your non-Bourne shell setup into some
2013 other files. For example, bash reads the file @file{~/.bash_profile}
2014 instead of @file{~/.profile}, if the former exists. So bash
2015 aficionados just rename their @file{~/.profile} to
2016 @file{~/.bash_profile} on all remote hosts, and Bob's your uncle.
2018 The @value{tramp} developers would like to circumvent this problem, so
2019 if you have an idea about it, please tell us. However, we are afraid
2020 it is not that simple: before saying @command{exec /bin/sh},
2021 @value{tramp} does not know which kind of shell it might be talking
2022 to. It could be a Bourne-ish shell like ksh or bash, or it could be a
2023 csh derivative like tcsh, or it could be zsh, or even rc. If the
2024 shell is Bourne-ish already, then it might be prudent to omit the
2025 @command{exec /bin/sh} step. But how to find out if the shell is
2029 @item Interactive shell prompt
2031 @value{tramp} redefines the shell prompt in order to parse the shell's
2032 output robustly. When calling an interactive shell by @kbd{M-x
2033 shell}, this doesn't look nice.
2035 You can redefine the shell prompt by checking the environment variable
2036 @env{INSIDE_EMACS}, which is set by @value{tramp}, in your startup
2037 script @file{~/.emacs_SHELLNAME}. @env{SHELLNAME} might be the string
2038 @code{bash} or similar, in case of doubt you could set it the
2039 environment variable @env{ESHELL} in your @file{.emacs}:
2042 (setenv "ESHELL" "bash")
2045 Your file @file{~/.emacs_SHELLNAME} could contain code like
2048 # Reset the prompt for remote Tramp shells.
2049 if [ "$@{INSIDE_EMACS/*tramp*/tramp@}" == "tramp" ] ; then
2056 @xref{Interactive Shell, , , @value{emacsdir}}.
2063 @node Android shell setup
2064 @section Android shell setup hints
2065 @cindex android shell setup
2067 Android devices use a restricted shell. They can be accessed via the
2068 @option{adb} method. However, this restricts the access to a USB
2069 connection, and it requires the installation of the Android SDK on the
2072 When an @command{sshd} process runs on the Android device, like
2073 provided by the @code{SSHDroid} app, any @option{ssh}-based method can
2074 be used. This requires some special settings.
2076 The default shell @code{/bin/sh} does not exist. Instead, you shall
2077 use just @code{sh}, which invokes the shell installed on the device.
2078 You can instruct @value{tramp} by this form:
2081 (add-to-list 'tramp-connection-properties
2082 (list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
2086 with @samp{192.168.0.26} being the IP address of your Android device
2087 (@pxref{Predefined connection information}).
2089 The user settings for the @env{PATH} environment variable must be
2090 preserved. It has also been reported, that the commands in
2091 @file{/system/xbin} are better suited than the ones in
2092 @file{/system/bin}. Add these setting:
2095 (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
2096 (add-to-list 'tramp-remote-path "/system/xbin")
2100 If the Android device is not @samp{rooted}, you must give the shell a
2101 writable directory for temporary files:
2104 (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME")
2108 Now you shall be able to open a remote connection with @kbd{C-x C-f
2109 @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd}
2110 listens on port @samp{2222}.
2112 It is also recommended to add a corresponding entry to your
2113 @file{~/.ssh/config} for that connection, like
2117 HostName 192.168.0.26
2123 In this case, you must change the setting for the remote shell to
2126 (add-to-list 'tramp-connection-properties
2127 (list (regexp-quote "android") "remote-shell" "sh"))
2131 You would open the connection with @kbd{C-x C-f @trampfn{ssh, ,
2135 @node Auto-save and Backup
2136 @section Auto-save and Backup configuration
2140 @vindex backup-directory-alist
2143 @vindex bkup-backup-directory-info
2146 Normally, @value{emacsname} writes backup files to the same directory
2147 as the original files, but this behavior can be changed via the
2150 @code{backup-directory-alist}.
2153 @code{bkup-backup-directory-info}.
2155 In connection with @value{tramp}, this can have unexpected side
2156 effects. Suppose that you specify that all backups should go to the
2157 directory @file{~/.emacs.d/backups/}, and then you edit the file
2158 @file{@trampfn{su, root, localhost, /etc/secretfile}}. The effect is
2159 that the backup file will be owned by you and not by root, thus
2160 possibly enabling others to see it even if they were not intended to
2165 @code{backup-directory-alist}
2168 @code{bkup-backup-directory-info}
2170 is @code{nil} (the default), such problems do not occur.
2172 Therefore, it is useful to set special values for @value{tramp}
2173 files. For example, the following statement effectively `turns off'
2176 @code{backup-directory-alist}
2179 @code{bkup-backup-directory-info}
2181 for @value{tramp} files:
2185 (add-to-list 'backup-directory-alist
2186 (cons tramp-file-name-regexp nil))
2191 (require 'backup-dir)
2192 (add-to-list 'bkup-backup-directory-info
2193 (list tramp-file-name-regexp ""))
2198 It is also possible to disable backups depending on the used method.
2199 The following code disables backups for the @option{su} and
2200 @option{sudo} methods:
2203 (setq backup-enable-predicate
2205 (and (normal-backup-enable-predicate name)
2207 (let ((method (file-remote-p name 'method)))
2208 (when (stringp method)
2209 (member method '("su" "sudo"))))))))
2214 Another possibility is to use the @value{tramp} variable
2216 @code{tramp-backup-directory-alist}.
2219 @code{tramp-bkup-backup-directory-info}.
2221 This variable has the same meaning like
2223 @code{backup-directory-alist}.
2226 @code{bkup-backup-directory-info}.
2228 If a @value{tramp} file is backed up, and DIRECTORY is an absolute
2229 local file name, DIRECTORY is prepended with the @value{tramp} file
2230 name prefix of the file to be backed up.
2237 (add-to-list 'backup-directory-alist
2238 (cons "." "~/.emacs.d/backups/"))
2239 (setq tramp-backup-directory-alist backup-directory-alist)
2244 (require 'backup-dir)
2245 (add-to-list 'bkup-backup-directory-info
2246 (list "." "~/.emacs.d/backups/" 'full-path))
2247 (setq tramp-bkup-backup-directory-info bkup-backup-directory-info)
2252 The backup file name of @file{@trampfn{su, root, localhost,
2253 /etc/secretfile}} would be
2255 @file{@trampfn{su, root, localhost,
2256 ~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
2259 @file{@trampfn{su, root, localhost,
2260 ~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
2263 The same problem can happen with auto-saving files.
2265 The variable @code{auto-save-file-name-transforms} keeps information,
2266 on which directory an auto-saved file should go. By default, it is
2267 initialized for @value{tramp} files to the local temporary directory.
2269 On some versions of @value{emacsname}, namely the version built for
2270 Debian GNU/Linux, the variable @code{auto-save-file-name-transforms}
2271 contains the directory where @value{emacsname} was built. A
2272 workaround is to manually set the variable to a sane value.
2274 If auto-saved files should go into the same directory as the original
2275 files, @code{auto-save-file-name-transforms} should be set to @code{nil}.
2277 Another possibility is to set the variable
2278 @code{tramp-auto-save-directory} to a proper value.
2281 For this purpose you can set the variable @code{auto-save-directory}
2286 @node Windows setup hints
2287 @section Issues with Cygwin ssh
2288 @cindex Cygwin, issues
2290 This section needs a lot of work! Please help.
2292 @cindex method sshx with Cygwin
2293 @cindex sshx method with Cygwin
2294 The recent Cygwin installation of @command{ssh} works only with a
2295 Cygwinized @value{emacsname}. You can check it by typing @kbd{M-x
2296 eshell}, and starting @kbd{ssh test.host}. The problem is evident
2297 if you see a message like this:
2300 Pseudo-terminal will not be allocated because stdin is not a terminal.
2303 Older @command{ssh} versions of Cygwin are told to cooperate with
2304 @value{tramp} selecting @option{sshx} as the connection method. You
2305 can find information about setting up Cygwin in their FAQ at
2306 @uref{http://cygwin.com/faq/}.
2308 @cindex method scpx with Cygwin
2309 @cindex scpx method with Cygwin
2310 If you wish to use the @option{scpx} connection method, then you might
2311 have the problem that @value{emacsname} calls @command{scp} with a
2312 Windows file name such as @code{c:/foo}. The Cygwin version of
2313 @command{scp} does not know about Windows file names and interprets
2314 this as a remote file name on the host @code{c}.
2316 One possible workaround is to write a wrapper script for @option{scp}
2317 which converts the Windows file name to a Cygwinized file name.
2319 @cindex Cygwin and ssh-agent
2320 @cindex SSH_AUTH_SOCK and @value{emacsname} on Windows
2321 If you want to use either @option{ssh} based method on Windows, then
2322 you might encounter problems with @command{ssh-agent}. Using this
2323 program, you can avoid typing the pass-phrase every time you log in.
2324 However, if you start @value{emacsname} from a desktop shortcut, then
2325 the environment variable @env{SSH_AUTH_SOCK} is not set and so
2326 @value{emacsname} and thus @value{tramp} and thus @command{ssh} and
2327 @command{scp} started from @value{tramp} cannot communicate with
2328 @command{ssh-agent}. It works better to start @value{emacsname} from
2331 If anyone knows how to start @command{ssh-agent} under Windows in such a
2332 way that desktop shortcuts can profit, please holler. I don't really
2333 know anything at all about Windows@dots{}
2337 @chapter Using @value{tramp}
2338 @cindex using @value{tramp}
2340 Once you have installed @value{tramp} it will operate fairly
2341 transparently. You will be able to access files on any remote host
2342 that you can log in to as though they were local.
2344 Files are specified to @value{tramp} using a formalized syntax specifying the
2345 details of the system to connect to. This is similar to the syntax used
2346 by the @value{ftppackagename} package.
2349 Something that might happen which surprises you is that
2350 @value{emacsname} remembers all your keystrokes, so if you see a
2351 password prompt from @value{emacsname}, say, and hit @kbd{@key{RET}}
2352 twice instead of once, then the second keystroke will be processed by
2353 @value{emacsname} after @value{tramp} has done its thing. Why, this
2354 type-ahead is normal behavior, you say. Right you are, but be aware
2355 that opening a remote file might take quite a while, maybe half a
2356 minute when a connection needs to be opened. Maybe after half a
2357 minute you have already forgotten that you hit that key!
2360 * File name Syntax:: @value{tramp} file name conventions.
2361 * File name completion:: File name completion.
2362 * Ad-hoc multi-hops:: Declaring multiple hops in the file name.
2363 * Remote processes:: Integration with other @value{emacsname} packages.
2364 * Cleanup remote connections:: Cleanup remote connections.
2368 @node File name Syntax
2369 @section @value{tramp} file name conventions
2370 @cindex file name syntax
2371 @cindex file name examples
2373 To access the file @var{localname} on the remote host @var{host}
2374 you would specify the file name @file{@trampfn{, , host,
2375 localname}}. This will connect to @var{host} and transfer the file
2376 using the default method. @xref{Default Method}.
2378 Some examples of @value{tramp} file names are shown below.
2381 @item @value{prefix}melancholia@value{postfix}.emacs
2382 Edit the file @file{.emacs} in your home directory on the host
2385 @item @value{prefix}melancholia.danann.net@value{postfix}.emacs
2386 This edits the same file, using the fully qualified domain name of
2389 @item @value{prefix}melancholia@value{postfix}~/.emacs
2390 This also edits the same file; the @file{~} is expanded to your
2391 home directory on the remote host, just like it is locally.
2393 @item @value{prefix}melancholia@value{postfix}~daniel/.emacs
2394 This edits the file @file{.emacs} in the home directory of the user
2395 @code{daniel} on the host @code{melancholia}. The @file{~<user>}
2396 construct is expanded to the home directory of that user on the remote
2399 @item @value{prefix}melancholia@value{postfix}/etc/squid.conf
2400 This edits the file @file{/etc/squid.conf} on the host
2405 @var{host} can also be an IPv4 or IPv6 address, like in
2406 @file{@trampfn{, , 127.0.0.1, .emacs}} or @file{@trampfn{, ,
2407 @value{ipv6prefix}::1@value{ipv6postfix}, .emacs}}.
2409 For syntactical reasons, IPv6 addresses must be embedded in square
2410 brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}.
2413 Unless you specify a different name to use, @value{tramp} will use the
2414 current local user name as the remote user name to log in with. If you
2415 need to log in as a different user, you can specify the user name as
2416 part of the file name.
2418 To log in to the remote host as a specific user, you use the syntax
2419 @file{@trampfn{, user, host, path/to.file}}. That means that
2420 connecting to @code{melancholia} as @code{daniel} and editing
2421 @file{.emacs} in your home directory you would specify
2422 @file{@trampfn{, daniel, melancholia, .emacs}}.
2424 It is also possible to specify other file transfer methods
2425 (@pxref{Inline methods}, @pxref{External methods}) as part of the
2428 This is done by putting the method before the user and host name, as
2429 in @file{@value{prefix}@var{method}@value{postfixhop}} (Note the
2433 This is done by replacing the initial @file{@value{prefix}} with
2434 @file{@value{prefix}<method>@value{postfixhop}}. (Note the trailing
2437 The user, host and file specification remain the same.
2439 So, to connect to the host @code{melancholia} as @code{daniel},
2440 using the @option{ssh} method to transfer files, and edit
2441 @file{.emacs} in my home directory I would specify the file name
2442 @file{@trampfn{ssh, daniel, melancholia, .emacs}}.
2445 A remote file name containing a host name only, which is equal to a
2446 method name, is not allowed. If such a host name is used, it must
2447 always be preceded by an explicit method name, like
2448 @file{@value{prefix}ssh@value{postfixhop}ssh@value{postfix}}.
2451 Finally, for some methods it is possible to specify a different port
2452 number than the default one, given by the method. This is specified
2453 by adding @file{#<port>} to the host name, like in @file{@trampfn{ssh,
2454 daniel, melancholia#42, .emacs}}.
2457 @node File name completion
2458 @section File name completion
2459 @cindex file name completion
2461 File name completion works with @value{tramp} for completion of method
2462 names, of user names and of host names as well as for completion of
2463 file names on remote hosts.
2465 In order to enable this, partial completion must be activated in your
2468 @xref{Completion Options, , , @value{emacsdir}}.
2472 If you, for example, type @kbd{C-x C-f @value{prefix}t
2473 @key{TAB}}, @value{tramp} might give you as result the choice for
2476 @c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
2477 @multitable @columnfractions .5 .5
2479 @item @value{prefixhop}telnet@value{postfixhop} @tab tmp/
2480 @item @value{prefixhop}toto@value{postfix} @tab
2483 @item @value{prefixhop}telnet@value{postfixhop} @tab @value{prefixhop}toto@value{postfix}
2488 @samp{@value{prefixhop}telnet@value{postfixhop}}
2489 is a possible completion for the respective method,
2491 @samp{tmp/} stands for the directory @file{/tmp} on your local host,
2493 and @samp{@value{prefixhop}toto@value{postfix}}
2494 might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
2495 file (given you're using default method @option{ssh}).
2497 If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to
2498 @samp{@value{prefix}telnet@value{postfixhop}}.
2499 Next @kbd{@key{TAB}} brings you all host names @value{tramp} detects in
2500 your @file{/etc/hosts} file, let's say
2503 @multitable @columnfractions .5 .5
2504 @c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
2505 @item @trampfn{telnet, , 127.0.0.1,} @tab @trampfn{telnet, , 192.168.0.1,}
2506 @item @trampfn{telnet, , @value{ipv6prefix}::1@value{ipv6postfix},} @tab @trampfn{telnet, , localhost,}
2507 @item @trampfn{telnet, , melancholia.danann.net,} @tab @trampfn{telnet, , melancholia,}
2511 Now you can choose the desired host, and you can continue to
2512 complete file names on that host.
2514 If the configuration files (@pxref{Customizing Completion}), which
2515 @value{tramp} uses for analysis of completion, offer user names, those user
2516 names will be taken into account as well.
2518 Remote hosts which have been visited in the past and kept
2519 persistently (@pxref{Connection caching}) will be offered too.
2521 Once the remote host identification is completed, it comes to
2522 file name completion on the remote host. This works pretty much like
2523 for files on the local host, with the exception that minibuffer
2524 killing via a double-slash works only on the file name part, except
2525 that file name part starts with @file{//}.
2527 A triple-slash stands for the default behavior.
2530 @xref{Minibuffer File, , , @value{emacsdir}}.
2538 @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin//etc} @key{TAB}}
2539 @print{} @trampfn{telnet, , melancholia, /etc}
2541 @kbd{C-x C-f @trampfn{telnet, , melancholia, //etc} @key{TAB}}
2544 @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin///etc} @key{TAB}}
2549 @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin//}}
2550 @print{} @trampfn{telnet, , melancholia, /}
2552 @kbd{C-x C-f @trampfn{telnet, , melancholia, //}}
2557 A remote directory might have changed its contents out of
2558 @value{emacsname} control, for example by creation or deletion of
2559 files by other processes. Therefore, during file name completion, the
2560 remote directory contents are reread regularly in order to detect such
2561 changes, which would be invisible otherwise (@pxref{Connection caching}).
2563 @defopt tramp-completion-reread-directory-timeout
2564 This variable defines the number of seconds since last remote command
2565 before rereading a directory contents. A value of 0 would require an
2566 immediate reread during file name completion, @code{nil} means to use
2567 always cached values for the directory contents.
2571 @node Ad-hoc multi-hops
2572 @section Declaring multiple hops in the file name
2573 @cindex multi-hop, ad-hoc
2574 @cindex proxy hosts, ad-hoc
2576 Multiple hops are configured with the variable
2577 @code{tramp-default-proxies-alist} (@pxref{Multi-hops}). However,
2578 sometimes it is desirable to reach a remote host immediately, without
2579 configuration changes. This can be reached by an ad-hoc specification
2582 A proxy looks like a remote file name specification without the local
2583 file name part. It is prepended to the target remote file name,
2584 separated by @samp{|}. As an example, a remote file on
2585 @samp{you@@remotehost}, passing the proxy @samp{bird@@bastion}, could
2589 @c @kbd{C-x C-f @trampfn{ssh@value{postfixhop}bird@@bastion|ssh, you,
2590 @c remotehost, /path}}
2591 @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path}
2594 Multiple hops can be cascaded, separating all proxies by @samp{|}.
2595 The proxies can also contain the patterns @code{%h} or @code{%u}.
2597 The ad-hoc definition is added on the fly to
2598 @code{tramp-default-proxies-alist}. Therefore, during the lifetime of
2599 the @value{emacsname} session it is not necessary to enter this ad-hoc
2600 specification, again. The remote file name @samp{@trampfn{ssh, you,
2601 remotehost, /path}} would be sufficient from now on.
2603 @vindex tramp-save-ad-hoc-proxies
2604 @defopt tramp-save-ad-hoc-proxies
2605 This customer option controls whether ad-hoc definitions are kept
2606 persistently in @code{tramp-default-proxies-alist}. That means, those
2607 definitions are available also for future @value{emacsname} sessions.
2611 @node Remote processes
2612 @section Integration with other @value{emacsname} packages
2616 @value{tramp} supports running processes on a remote host. This
2617 allows to exploit @value{emacsname} packages without modification for
2618 remote file names. It does not work for the @option{ftp} method.
2619 Association of a pty, as specified in @code{start-file-process}, is
2622 @code{process-file} and @code{start-file-process} work on the remote
2623 host when the variable @code{default-directory} is remote:
2626 (let ((default-directory "/ssh:remote.host:"))
2627 (start-file-process "grep" (get-buffer-create "*grep*")
2628 "/bin/sh" "-c" "grep -e tramp *"))
2632 If the remote host is mounted via GVFS (see @ref{GVFS based methods}),
2633 the remote filesystem is mounted locally. Therefore, there are no
2634 remote processes; all processes run still locally on your host with
2635 an adapted @code{default-directory}. This section does not apply for
2636 such connection methods.
2639 Remote processes are started when a corresponding command is executed
2640 from a buffer belonging to a remote file or directory. Up to now, the
2641 packages @file{compile.el} (commands like @code{compile} and
2642 @code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}) have been
2643 integrated. Integration of further packages is planned, any help for
2646 When your program is not found in the default search path
2647 @value{tramp} sets on the remote host, you should either use an
2648 absolute path, or extend @code{tramp-remote-path} (see @ref{Remote
2652 (add-to-list 'tramp-remote-path "~/bin")
2653 (add-to-list 'tramp-remote-path "/appli/pub/bin")
2656 The environment for your program can be adapted by customizing
2657 @code{tramp-remote-process-environment}. This variable is a list of
2658 strings. It is structured like @code{process-environment}. Each
2659 element is a string of the form @code{"ENVVARNAME=VALUE"}. An entry
2660 @code{"ENVVARNAME="} disables the corresponding environment variable,
2661 which might have been set in your init file like @file{~/.profile}.
2664 Adding an entry can be performed via @code{add-to-list}:
2667 (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java")
2670 Changing or removing an existing entry is not encouraged. The default
2671 values are chosen for proper @value{tramp} work. Nevertheless, if for
2672 example a paranoid system administrator disallows changing the
2673 @env{HISTORY} environment variable, you can customize
2674 @code{tramp-remote-process-environment}, or you can apply the
2675 following code in your @file{.emacs}:
2678 (let ((process-environment tramp-remote-process-environment))
2679 (setenv "HISTORY" nil)
2680 (setq tramp-remote-process-environment process-environment))
2683 If you use other @value{emacsname} packages which do not run
2684 out-of-the-box on a remote host, please let us know. We will try to
2685 integrate them as well. @xref{Bug Reports}.
2688 @subsection Running remote programs that create local X11 windows
2690 If you want to run a remote program, which shall connect the X11
2691 server you are using with your local host, you can set the
2692 @env{DISPLAY} environment variable on the remote host:
2695 (add-to-list 'tramp-remote-process-environment
2696 (format "DISPLAY=%s" (getenv "DISPLAY")))
2700 @code{(getenv "DISPLAY")} shall return a string containing a host
2701 name, which can be interpreted on the remote host; otherwise you might
2702 use a fixed host name. Strings like @code{:0} cannot be used properly
2705 Another trick might be that you put @code{ForwardX11 yes} or
2706 @code{ForwardX11Trusted yes} to your @file{~/.ssh/config} file for
2710 @subsection Running @code{shell} on a remote host
2713 Calling @kbd{M-x shell} in a buffer related to a remote host runs the
2714 local shell as defined in @option{shell-file-name}. This might be
2715 also a valid file name for a shell to be applied on the remote host,
2716 but it will fail at least when your local and remote hosts belong to
2717 different system types, like @samp{windows-nt} and @samp{gnu/linux}.
2719 You must set the variable @option{explicit-shell-file-name} to the
2720 shell file name on the remote host, in order to start that shell on
2724 Starting with Emacs 24 this won't be necessary, if you call
2725 @code{shell} interactively. You will be asked for the remote shell
2726 file name, if you are on a remote buffer, and if
2727 @option{explicit-shell-file-name} is equal to @code{nil}.
2731 @subsection Running @code{shell-command} on a remote host
2732 @cindex shell-command
2734 @code{shell-command} allows to execute commands in a shell, either
2735 synchronously, either asynchronously. This works also on remote
2739 @kbd{C-x C-f @trampfn{sudo, , , } @key{RET}}
2740 @kbd{M-! tail -f /var/log/syslog.log & @key{RET}}
2743 You will see the buffer @file{*Async Shell Command*}, containing the
2744 continuous output of the @command{tail} command.
2747 A similar behavior can be reached by @kbd{M-x auto-revert-tail-mode},
2752 @subsection Running @code{eshell} on a remote host
2755 @value{tramp} is integrated into @file{eshell.el}. That is, you can
2756 open an interactive shell on your remote host, and run commands there.
2757 After you have started @kbd{M-x eshell}, you could perform commands
2761 @b{~ $} cd @trampfn{sudo, , , /etc} @key{RET}
2762 @b{@trampfn{sudo, root, host, /etc} $} hostname @key{RET}
2764 @b{@trampfn{sudo, root, host, /etc} $} id @key{RET}
2765 uid=0(root) gid=0(root) groups=0(root)
2766 @b{@trampfn{sudo, root, host, /etc} $} find-file shadow @key{RET}
2768 @b{@trampfn{sudo, root, host, /etc} $}
2772 Since @value{emacsname} 23.2, @code{eshell} has also an own
2773 implementation of the @code{su} and @code{sudo} commands. Both
2774 commands change the default directory of the @file{*eshell*} buffer to
2775 the value related to the user the command has switched to. This works
2776 even on remote hosts, adding silently a corresponding entry to the
2777 variable @code{tramp-default-proxies-alist} (@pxref{Multi-hops}):
2780 @b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET}
2781 @b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow @key{RET}
2782 File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow}
2783 @b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow @key{RET}
2786 @b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET}
2787 @b{@trampfn{su, root, remotehost, /root} $} id @key{RET}
2788 uid=0(root) gid=0(root) groups=0(root)
2789 @b{@trampfn{su, root, remotehost, /root} $}
2794 @anchor{Running a debugger on a remote host}
2795 @subsection Running a debugger on a remote host
2800 @file{gud.el} offers an unified interface to several symbolic
2804 (@ref{Debuggers, , , @value{emacsdir}}).
2807 With @value{tramp}, it is possible to debug programs on
2808 remote hosts. You can call @code{gdb} with a remote file name:
2811 @kbd{M-x gdb @key{RET}}
2812 @b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, ~/myprog} @key{RET}
2815 The file name can also be relative to a remote default directory.
2816 Given you are in a buffer that belongs to the remote directory
2817 @trampfn{ssh, , host, /home/user}, you could call
2820 @kbd{M-x perldb @key{RET}}
2821 @b{Run perldb (like this):} perl -d myprog.pl @key{RET}
2824 It is not possible to use just the absolute local part of a remote
2825 file name as program to debug, like @kbd{perl -d
2826 /home/user/myprog.pl}, though.
2828 Arguments of the program to be debugged are taken literally. That
2829 means, file names as arguments must be given as ordinary relative or
2830 absolute file names, without any remote specification.
2833 @subsection Running remote processes on Windows hosts
2837 With the help of the @command{winexe} it is possible tu run processes
2838 on a remote Windows host. @value{tramp} has implemented this for
2839 @code{process-file} and @code{start-file-process}.
2841 The variable @code{tramp-smb-winexe-program} must contain the file
2842 name of your local @command{winexe} command. On the remote host,
2843 Powershell V2.0 must be installed; it is used to run the remote
2846 In order to open a remote shell on the Windows host via @kbd{M-x
2847 shell}, you must set the variables @option{explicit-shell-file-name}
2848 and @option{explicit-*-args}. If you want, for example, run
2849 @command{cmd}, you must set:
2852 (setq explicit-shell-file-name "cmd"
2853 explicit-cmd-args '("/q"))
2857 In case of running @command{powershell} as remote shell, the settings are
2860 (setq explicit-shell-file-name "powershell"
2861 explicit-powershell-args '("-file" "-"))
2865 @node Cleanup remote connections
2866 @section Cleanup remote connections
2869 Sometimes it is useful to cleanup remote connections. The following
2870 commands support this.
2872 @deffn Command tramp-cleanup-connection vec
2873 This command flushes all connection related objects. @option{vec} is
2874 the internal representation of a remote connection. Called
2875 interactively, the command offers all active remote connections in the
2876 minibuffer as remote file name prefix like @file{@trampfn{method,
2877 user, host, }}. The cleanup includes password cache (@pxref{Password
2878 handling}), file cache, connection cache (@pxref{Connection caching}),
2882 @deffn Command tramp-cleanup-this-connection
2883 This command flushes all objects of the current buffer's remote
2884 connection. The same objects are removed as in
2885 @code{tramp-cleanup-connection}.
2888 @deffn Command tramp-cleanup-all-connections
2889 This command flushes objects for all active remote connections. The
2890 same objects are removed as in @code{tramp-cleanup-connection}.
2893 @deffn Command tramp-cleanup-all-buffers
2894 Like in @code{tramp-cleanup-all-connections}, all remote connections
2895 are cleaned up. Additionally all buffers, which are related to a
2896 remote connection, are killed.
2901 @chapter Reporting Bugs and Problems
2904 Bugs and problems with @value{tramp} are actively worked on by the
2905 development team. Feature requests and suggestions are also more than
2908 The @value{tramp} mailing list is a great place to get information on
2909 working with @value{tramp}, solving problems and general discussion
2910 and advice on topics relating to the package. It is moderated so
2911 non-subscribers can post but messages will be delayed, possibly up to
2912 48 hours (or longer in case of holidays), until the moderator approves
2915 The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to
2916 this address go to all the subscribers. This is @emph{not} the address
2917 to send subscription requests to.
2919 Subscribing to the list is performed via
2920 @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/,
2921 the @value{tramp} Mail Subscription Page}.
2924 @ifset installchapter
2925 Before sending a bug report, you could check whether @value{tramp}
2926 works at all. Run the test suite on your local host, @ref{Testing}.
2931 To report a bug in @value{tramp}, you should execute @kbd{M-x
2932 tramp-bug}. This will automatically generate a buffer with the details
2933 of your system and @value{tramp} version.
2935 When submitting a bug report, please try to describe in excruciating
2936 detail the steps required to reproduce the problem, the setup of the
2937 remote host and any special conditions that exist. You should also
2938 check that your problem is not described already in @xref{Frequently
2941 If you can identify a minimal test case that reproduces the problem,
2942 include that with your bug report. This will make it much easier for
2943 the development team to analyze and correct the problem.
2945 Sometimes, there might be also problems due to Tramp caches. Flush
2946 all caches before running the test, @ref{Cleanup remote connections}.
2948 Before reporting the bug, you should set the verbosity level to 6
2949 (@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and
2950 repeat the bug. Then, include the contents of the @file{*tramp/foo*}
2951 and @file{*debug tramp/foo*} buffers in your bug report. A verbosity
2952 level greater than 6 will produce a very huge debug buffer, which is
2953 mostly not necessary for the analysis.
2955 Please be aware that, with a verbosity level of 6 or greater, the
2956 contents of files and directories will be included in the debug
2957 buffer. Passwords you've typed will never be included there.
2960 @node Frequently Asked Questions
2961 @chapter Frequently Asked Questions
2962 @cindex frequently asked questions
2967 Where can I get the latest @value{tramp}?
2969 @value{tramp} is available under the URL below.
2972 @uref{ftp://ftp.gnu.org/gnu/tramp/}
2975 There is also a Savannah project page.
2978 @uref{http://savannah.gnu.org/projects/tramp/}
2982 Which systems does it work on?
2984 The package has been used successfully on Emacs 22, Emacs 23, Emacs
2985 24, XEmacs 21 (starting with 21.4), and SXEmacs 22.
2987 The package was intended to work on Unix, and it really expects a
2988 Unix-like system on the remote end (except the @option{smb} method),
2989 but some people seemed to have some success getting it to work on MS
2990 Windows XP/Vista/7 @value{emacsname}.
2994 How could I speed up @value{tramp}?
2996 In the backstage, @value{tramp} needs a lot of operations on the
2997 remote host. The time for transferring data from and to the remote
2998 host as well as the time needed to perform the operations there count.
2999 In order to speed up @value{tramp}, one could either try to avoid some
3000 of the operations, or one could try to improve their performance.
3002 Use an external method, like @option{scp}.
3004 Use caching. This is already enabled by default. Information about
3005 the remote host as well as the remote files are cached for reuse. The
3006 information about remote hosts is kept in the file specified in
3007 @code{tramp-persistency-file-name}. Keep this file. If you are
3008 confident that files on remote hosts are not changed out of
3009 @value{emacsname}' control, set @code{remote-file-name-inhibit-cache}
3010 to @code{nil}. Set also @code{tramp-completion-reread-directory-timeout}
3011 to @code{nil}, @ref{File name completion}.
3013 Disable version control. If you access remote files which are not
3014 under version control, a lot of check operations can be avoided by
3015 disabling VC@. This can be achieved by
3018 (setq vc-ignore-dir-regexp
3019 (format "\\(%s\\)\\|\\(%s\\)"
3020 vc-ignore-dir-regexp
3021 tramp-file-name-regexp))
3024 Disable excessive traces. The default trace level of @value{tramp},
3025 defined in the variable @code{tramp-verbose}, is 3. You should
3026 increase this level only temporarily, hunting bugs.
3030 @value{tramp} does not connect to the remote host
3032 When @value{tramp} does not connect to the remote host, there are three
3033 reasons heading the bug mailing list:
3037 Unknown characters in the prompt
3039 @value{tramp} needs to recognize the prompt on the remote host
3040 after execution any command. This is not possible when the prompt
3041 contains unknown characters like escape sequences for coloring. This
3042 should be avoided on the remote side. @xref{Remote shell setup}. for
3043 setting the regular expression detecting the prompt.
3045 You can check your settings after an unsuccessful connection by
3046 switching to the @value{tramp} connection buffer @file{*tramp/foo*},
3047 setting the cursor at the top of the buffer, and applying the expression
3050 @kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))}
3053 If it fails, or the cursor is not moved at the end of the buffer, your
3054 prompt is not recognized correctly.
3056 A special problem is the zsh shell, which uses left-hand side and
3057 right-hand side prompts in parallel. Therefore, it is necessary to
3058 disable the zsh line editor on the remote host. You shall add to
3059 @file{~/.zshrc} the following command:
3062 [ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
3065 Similar fancy prompt settings are known from the fish shell. Here you
3066 must add in @file{~/.config/fish/config.fish}:
3069 function fish_prompt
3070 if test $TERM = "dumb"
3078 Furthermore it has been reported, that @value{tramp} (like sshfs,
3079 incidentally) doesn't work with WinSSHD due to strange prompt settings.
3082 Echoed characters after login
3084 When the remote host opens an echoing shell, there might be control
3085 characters in the welcome message. @value{tramp} tries to suppress
3086 such echoes via the @command{stty -echo} command, but sometimes this
3087 command is not reached, because the echoed output has confused
3088 @value{tramp} already. In such situations it might be helpful to use
3089 the @option{sshx} or @option{scpx} methods, which allocate a pseudo tty.
3090 @xref{Inline methods}.
3093 @value{tramp} doesn't transfer strings with more than 500 characters
3096 On some few systems, the implementation of @code{process-send-string}
3097 seems to be broken for longer strings. It is reported for HP-UX,
3098 FreeBSD and Tru64 Unix, for example. This case, you should customize
3099 the variable @code{tramp-chunksize} to 500. For a description how to
3100 determine whether this is necessary see the documentation of
3101 @code{tramp-chunksize}.
3103 Additionally, it will be useful to set @code{file-precious-flag} to
3104 @code{t} for @value{tramp} files. Then the file contents will be
3105 written into a temporary file first, which is checked for correct
3108 @pxref{Saving Buffers, , , elisp}
3115 (when (file-remote-p default-directory)
3116 (set (make-local-variable 'file-precious-flag) t))))
3122 @value{tramp} does not recognize hung @command{ssh} sessions
3124 When your network connection is down, @command{ssh} sessions might
3125 hang. @value{tramp} cannot detect it safely, because it still sees a
3126 running @command{ssh} process. Timeouts cannot be used as well,
3127 because it cannot be predicted how long a remote command will last,
3128 for example when copying very large files.
3130 Therefore, you must configure the @command{ssh} process to die
3131 in such a case. The following entry in @file{~/.ssh/config} would do
3136 ServerAliveInterval 5
3141 @value{tramp} does not use my @command{ssh} @code{ControlPath}
3143 Your @code{ControlPath} setting will be overwritten by @command{ssh}
3144 sessions initiated by @value{tramp}. This is because a master
3145 session, initiated outside @value{emacsname}, could be closed, which
3146 would stall all other @command{ssh} sessions for that host inside
3149 Consequently, if you connect to a remote host via @value{tramp}, you
3150 might be prompted for a password again, even if you have established
3151 already an @command{ssh} connection to that host. Further
3152 @value{tramp} connections to that host, for example in order to run a
3153 process on that host, will reuse that initial @command{ssh}
3156 If your @command{ssh} version supports the @code{ControlPersist}
3157 option, you could customize the variable
3158 @code{tramp-ssh-controlmaster-options} to use your @code{ControlPath},
3162 (setq tramp-ssh-controlmaster-options
3164 "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
3165 "-o ControlMaster=auto -o ControlPersist=yes"))
3168 Note, that "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and
3169 "%%p", respectively.
3171 These settings can be suppressed, if they are configured properly in
3172 your @file{~/.ssh/config}:
3175 (setq tramp-use-ssh-controlmaster-options nil)
3180 File name completion does not work with @value{tramp}
3182 When you log in to the remote host, do you see the output of
3183 @command{ls} in color? If so, this may be the cause of your problems.
3185 @command{ls} outputs @acronym{ANSI} escape sequences that your terminal
3186 emulator interprets to set the colors. These escape sequences will
3187 confuse @value{tramp} however.
3189 In your @file{.bashrc}, @file{.profile} or equivalent on the remote
3190 host you probably have an alias configured that adds the option
3191 @option{--color=yes} or @option{--color=auto}.
3193 You should remove that alias and ensure that a new login @emph{does not}
3194 display the output of @command{ls} in color. If you still cannot use
3195 file name completion, report a bug to the @value{tramp} developers.
3199 File name completion does not work in large directories
3201 @value{tramp} uses globbing for some operations. (Globbing means to use the
3202 shell to expand wildcards such as `*.c'.) This might create long
3203 command lines, especially in directories with many files. Some shells
3204 choke on long command lines, or don't cope well with the globbing
3207 If you have a large directory on the remote end, you may wish to execute
3208 a command like @samp{ls -d * ..?* > /dev/null} and see if it hangs.
3209 Note that you must first start the right shell, which might be
3210 @command{/bin/sh}, @command{ksh} or @command{bash}, depending on which
3211 of those supports tilde expansion.
3215 How can I get notified when @value{tramp} file transfers are complete?
3217 The following snippet can be put in your @file{~/.emacs} file. It
3218 makes @value{emacsname} beep after reading from or writing to the
3222 (defadvice tramp-handle-write-region
3223 (after tramp-write-beep-advice activate)
3224 "Make tramp beep after writing a file."
3228 (defadvice tramp-handle-do-copy-or-rename-file
3229 (after tramp-copy-beep-advice activate)
3230 "Make tramp beep after copying a file."
3234 (defadvice tramp-handle-insert-file-contents
3235 (after tramp-insert-beep-advice activate)
3236 "Make tramp beep after inserting a file."
3244 I'ld like to get a Visual Warning when working in a sudo:ed context
3246 When you are working with @samp{root} privileges, it might be useful
3247 to get an indication in the buffer's modeline. The following code,
3248 tested with @value{emacsname} 22.1, does the job. You should put it
3249 into your @file{~/.emacs}:
3252 (defun my-mode-line-function ()
3253 (when (string-match "^/su\\(do\\)?:" default-directory)
3254 (setq mode-line-format
3255 (format-mode-line mode-line-format 'font-lock-warning-face))))
3257 (add-hook 'find-file-hook 'my-mode-line-function)
3258 (add-hook 'dired-mode-hook 'my-mode-line-function)
3265 I'ld like to see a host indication in the mode line when I'm remote
3267 The following code has been tested with @value{emacsname} 22.1. You
3268 should put it into your @file{~/.emacs}:
3271 (defconst my-mode-line-buffer-identification
3275 (if (file-remote-p default-directory)
3276 (tramp-file-name-host
3277 (tramp-dissect-file-name default-directory))
3279 (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
3280 (substring host-name 0 (match-beginning 1))
3285 mode-line-buffer-identification
3286 my-mode-line-buffer-identification)
3292 mode-line-buffer-identification
3293 my-mode-line-buffer-identification)))
3296 Since @value{emacsname} 23.1, the mode line contains an indication if
3297 @code{default-directory} for the current buffer is on a remote host.
3298 The corresponding tooltip includes the name of that host. If you
3299 still want the host name as part of the mode line, you can use the
3300 example above, but the @code{:eval} clause can be simplified:
3305 (or (file-remote-p default-directory 'host)
3307 (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
3308 (substring host-name 0 (match-beginning 1))
3316 My remote host does not understand default directory listing options
3318 @value{emacsname} computes the @command{dired} options depending on
3319 the local host you are working. If your @command{ls} command on the
3320 remote host does not understand those options, you can change them
3325 'dired-before-readin-hook
3327 (when (file-remote-p default-directory)
3328 (setq dired-actual-switches "-al"))))
3334 There's this @file{~/.sh_history} file on the remote host which keeps
3335 growing and growing. What's that?
3337 Sometimes, @value{tramp} starts @command{ksh} on the remote host for
3338 tilde expansion. Maybe @command{ksh} saves the history by default.
3339 @value{tramp} tries to turn off saving the history, but maybe you have
3340 to help. For example, you could put this in your @file{.kshrc}:
3343 if [ -f $HOME/.sh_history ] ; then
3344 /bin/rm $HOME/.sh_history
3346 if [ "$@{HISTFILE-unset@}" != "unset" ] ; then
3349 if [ "$@{HISTSIZE-unset@}" != "unset" ] ; then
3354 Furthermore, if you use an @option{ssh}-based method, you could add
3355 the following line to your @file{~/.ssh/environment} file:
3362 @item There are longish file names to type. How to shorten this?
3364 Let's say you need regularly access to @file{@trampfn{ssh, news,
3365 news.my.domain, /opt/news/etc}}, which is boring to type again and
3366 again. The following approaches can be mixed:
3370 @item Use default values for method and user name:
3372 You can define default methods and user names for hosts,
3373 (@pxref{Default Method}, @pxref{Default User}):
3376 (setq tramp-default-method "ssh"
3377 tramp-default-user "news")
3380 The file name left to type would be
3381 @kbd{C-x C-f @trampfn{, , news.my.domain, /opt/news/etc}}.
3383 Note that there are some useful settings already. Accessing your
3384 local host as @samp{root} user, is possible just by @kbd{C-x C-f
3387 @item Use configuration possibilities of your method:
3389 Several connection methods (i.e., the programs used) offer powerful
3390 configuration possibilities (@pxref{Customizing Completion}). In the
3391 given case, this could be @file{~/.ssh/config}:
3395 HostName news.my.domain
3399 The file name left to type would be @kbd{C-x C-f @trampfn{ssh, , xy,
3400 /opt/news/etc}}. Depending on files in your directories, it is even
3401 possible to complete the host name with @kbd{C-x C-f
3402 @value{prefix}ssh@value{postfixhop}x @key{TAB}}.
3404 @item Use environment variables:
3406 File names typed in the minibuffer can be expanded by environment
3407 variables. You can set them outside @value{emacsname}, or even with
3411 (setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")
3414 Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you
3415 are. The disadvantage is that you cannot edit the file name, because
3416 environment variables are not expanded during editing in the
3419 @item Define own keys:
3421 You can define your own key sequences in @value{emacsname}, which can
3422 be used instead of @kbd{C-x C-f}:
3426 [(control x) (control y)]
3432 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))))
3435 Simply typing @kbd{C-x C-y} would initialize the minibuffer for
3436 editing with your beloved file name.
3438 See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the
3439 Emacs Wiki} for a more comprehensive example.
3441 @item Define own abbreviation (1):
3443 It is possible to define an own abbreviation list for expanding file
3448 'directory-abbrev-alist
3449 '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
3452 This shortens the file opening command to @kbd{C-x C-f /xy
3453 @key{RET}}. The disadvantage is, again, that you cannot edit the file
3454 name, because the expansion happens after entering the file name only.
3456 @item Define own abbreviation (2):
3458 The @code{abbrev-mode} gives more flexibility for editing the
3462 (define-abbrev-table 'my-tramp-abbrev-table
3463 '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))
3466 'minibuffer-setup-hook
3469 (setq local-abbrev-table my-tramp-abbrev-table)))
3471 (defadvice minibuffer-complete
3472 (before my-minibuffer-complete activate)
3475 ;; If you use partial-completion-mode
3476 (defadvice PC-do-completion
3477 (before my-PC-do-completion activate)
3481 After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is
3482 expanded, and you can continue editing.
3484 @item Use bookmarks:
3486 Bookmarks can be used to visit Tramp files or directories.
3488 @pxref{Bookmarks, , , @value{emacsdir}}
3491 When you have opened @file{@trampfn{ssh, news, news.my.domain,
3492 /opt/news/etc/}}, you should save the bookmark via
3494 @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}.
3497 @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
3500 Later on, you can always navigate to that bookmark via
3502 @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}.
3505 @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
3508 @item Use recent files:
3516 remembers visited places.
3519 @pxref{File Conveniences, , , @value{emacsdir}}
3522 @pxref{recent-files, , , edit-utils}
3526 You could keep remote file names in the recent list without checking
3527 their readability through a remote access:
3534 (recent-files-initialize)
3538 (when (file-remote-p (buffer-file-name))
3539 (recent-files-make-permanent)))
3544 The list of files opened recently is reachable via
3546 @kbd{@key{menu-bar} @key{file} @key{Open Recent}}.
3549 @kbd{@key{menu-bar} @key{Recent Files}}.
3553 @item Use filecache:
3555 @file{filecache} remembers visited places. Add the directory into
3559 (eval-after-load "filecache"
3560 '(file-cache-add-directory
3561 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
3564 Whenever you want to load a file, you can enter @kbd{C-x C-f
3565 C-@key{TAB}} in the minibuffer. The completion is done for the given
3572 @file{bbdb} has a built-in feature for @value{ftppackagename} files,
3573 which works also for @value{tramp}.
3575 @pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb}
3578 You need to load @file{bbdb}:
3585 Then you can create a BBDB entry via @kbd{M-x bbdb-create-ftp-site}.
3586 Because BBDB is not prepared for @value{tramp} syntax, you must
3587 specify a method together with the user name when needed. Example:
3590 @kbd{M-x bbdb-create-ftp-site @key{RET}}
3591 @b{Ftp Site:} news.my.domain @key{RET}
3592 @b{Ftp Directory:} /opt/news/etc/ @key{RET}
3593 @b{Ftp Username:} ssh@value{postfixhop}news @key{RET}
3594 @b{Company:} @key{RET}
3595 @b{Additional Comments:} @key{RET}
3598 When you have opened your BBDB buffer, you can access such an entry by
3599 pressing the key @key{F}.
3604 I would like to thank all @value{tramp} users who have contributed to
3605 the different recipes!
3610 How can I use @value{tramp} to connect to a remote @value{emacsname}
3613 You can configure Emacs Client doing this.
3615 @xref{Emacs Server, , , @value{emacsdir}}.
3618 On the remote host, you start the Emacs Server:
3622 (setq server-host (system-name)
3627 Make sure that the result of @code{(system-name)} can be resolved on
3628 your local host; otherwise you might use a hard coded IP address.
3630 The resulting file @file{~/.emacs.d/server/server} must be copied to
3631 your local host, at the same location. You can call then the Emacs
3632 Client from the command line:
3635 emacsclient @trampfn{ssh, user, host, /file/to/edit}
3638 @code{user} and @code{host} shall be related to your local host.
3640 If you want to use Emacs Client also as editor for other programs, you
3641 could write a script @file{emacsclient.sh}:
3645 emacsclient @trampfn{ssh, $(whoami), $(hostname --fqdn), $1}
3648 Then you must set the environment variable @env{EDITOR} pointing to
3652 export EDITOR=/path/to/emacsclient.sh
3658 There are packages which call @value{tramp} although I haven't entered
3659 a remote file name ever. I dislike it, how could I disable it?
3661 In general, @value{tramp} functions are used only when
3662 you apply remote file name syntax. However, some packages enable
3663 @value{tramp} on their own.
3669 You could disable @value{tramp} file name completion:
3672 (custom-set-variables
3673 '(ido-enable-tramp-completion nil))
3679 You could disable remote directory tracking mode:
3682 (rlogin-directory-tracking-mode -1)
3688 How can I disable @value{tramp} at all?
3690 Shame on you, why did you read until now?
3695 If you just want to have @value{ftppackagename} as default remote
3696 files access package, you should apply the following code:
3699 (setq tramp-default-method "ftp")
3706 @value{tramp} (and @value{ftppackagename}),
3711 you must set @code{tramp-mode} to @code{nil}:
3714 (setq tramp-mode nil)
3718 Unloading @value{tramp} can be achieved by applying @kbd{M-x
3719 tramp-unload-tramp}.
3721 This resets also the @value{ftppackagename} plugins.
3727 @c For the developer
3728 @node Files directories and localnames
3729 @chapter How file names, directories and localnames are mangled and managed.
3732 * Localname deconstruction:: Breaking a localname into its components.
3734 * External packages:: Integration with external Lisp packages.
3739 @node Localname deconstruction
3740 @section Breaking a localname into its components
3742 @value{tramp} file names are somewhat different, obviously, to ordinary file
3743 names. As such, the lisp functions @code{file-name-directory} and
3744 @code{file-name-nondirectory} are overridden within the @value{tramp}
3747 Their replacements are reasonably simplistic in their approach. They
3748 dissect the file name, call the original handler on the localname and
3749 then rebuild the @value{tramp} file name with the result.
3751 This allows the platform specific hacks in the original handlers to take
3752 effect while preserving the @value{tramp} file name information.
3756 @node External packages
3757 @section Integration with external Lisp packages
3758 @subsection File name completion.
3760 While reading file names in the minibuffer, @value{tramp} must decide
3761 whether it completes possible incomplete file names, or not. Imagine
3762 there is the following situation: You have typed @kbd{C-x C-f
3763 @value{prefix}ssh@value{postfixhop} @key{TAB}}. @value{tramp} cannot
3764 know, whether @option{ssh} is a method or a host name. It checks
3765 therefore the last input character you have typed. If this is
3766 @key{TAB}, @key{SPACE} or @kbd{?}, @value{tramp} assumes that you are
3767 still in file name completion, and it does not connect to the possible
3768 remote host @option{ssh}.
3770 External packages, which use other characters for completing file names
3771 in the minibuffer, must signal this to @value{tramp}. For this case,
3772 the variable @code{non-essential} can be bound temporarily to
3773 a non-@code{nil} value.
3776 (let ((non-essential t))
3781 @subsection File attributes cache.
3783 When @value{tramp} runs remote processes, files on the remote host
3784 could change their attributes. Consequently, @value{tramp} must flush
3785 its complete cache keeping attributes for all files of the remote host
3788 This is a performance degradation, because the lost file attributes
3789 must be recomputed when needed again. In cases where the caller of
3790 @code{process-file} knows that there are no file attribute changes, it
3791 should let-bind the variable @code{process-file-side-effects} to
3792 @code{nil}. Then @value{tramp} won't flush the file attributes cache.
3795 (let (process-file-side-effects)
3799 For asynchronous processes, @value{tramp} flushes the file attributes
3800 cache via a process sentinel. If the caller of
3801 @code{start-file-process} knows that there are no file attribute
3802 changes, it should set the process sentinel to the default. In cases
3803 where the caller defines its own process sentinel, @value{tramp}'s process
3804 sentinel is overwritten. The caller can still flush the file
3805 attributes cache in its process sentinel with this code:
3808 (unless (memq (process-status proc) '(run open))
3809 (dired-uncache remote-directory))
3812 @code{remote-directory} shall be the root directory, where file
3813 attribute changes can happen during the process lifetime.
3814 @value{tramp} traverses all subdirectories, starting at this
3815 directory. Often, it is sufficient to use @code{default-directory} of
3816 the process buffer as root directory.
3820 @node Traces and Profiles
3821 @chapter How to Customize Traces
3823 All @value{tramp} messages are raised with a verbosity level. The
3824 verbosity level can be any number between 0 and 10. Only messages with
3825 a verbosity level less than or equal to @code{tramp-verbose} are
3828 The verbosity levels are
3830 @w{ 0} silent (no @value{tramp} messages at all)
3831 @*@indent @w{ 1} errors
3832 @*@indent @w{ 2} warnings
3833 @*@indent @w{ 3} connection to remote hosts (default verbosity)
3834 @*@indent @w{ 4} activities
3835 @*@indent @w{ 5} internal
3836 @*@indent @w{ 6} sent and received strings
3837 @*@indent @w{ 7} file caching
3838 @*@indent @w{ 8} connection properties
3839 @*@indent @w{ 9} test commands
3840 @*@indent @w{10} traces (huge)
3842 When @code{tramp-verbose} is greater than or equal to 4, the messages
3843 are also written into a @value{tramp} debug buffer. This debug buffer
3844 is useful for analyzing problems; sending a @value{tramp} bug report
3845 should be done with @code{tramp-verbose} set to a verbosity level of at
3846 least 6 (@pxref{Bug Reports}).
3848 The debug buffer is in
3850 @ref{Outline Mode, , , @value{emacsdir}}.
3855 That means, you can change the level of messages to be viewed. If you
3856 want, for example, see only messages up to verbosity level 5, you must
3857 enter @kbd{C-u 6 C-c C-q}.
3859 Other keys for navigating are described in
3860 @ref{Outline Visibility, , , @value{emacsdir}}.
3863 @value{tramp} errors are handled internally in order to raise the
3864 verbosity level 1 messages. When you want to get a Lisp backtrace in
3865 case of an error, you need to set both
3868 (setq debug-on-error t
3872 Sometimes, it might be even necessary to step through @value{tramp}
3873 function call traces. Such traces are enabled by the following code:
3878 (dolist (elt (all-completions "tramp-" obarray 'functionp))
3879 (trace-function-background (intern elt)))
3880 (untrace-function 'tramp-read-passwd)
3881 (untrace-function 'tramp-gw-basic-authentication)
3884 The function call traces are inserted in the buffer
3885 @file{*trace-output*}. @code{tramp-read-passwd} and
3886 @code{tramp-gw-basic-authentication} shall be disabled when the
3887 function call traces are added to @value{tramp}, because both
3888 functions return password strings, which should not be distributed.
3892 @chapter Debatable Issues and What Was Decided
3895 @item The uuencode method does not always work.
3897 Due to the design of @value{tramp}, the encoding and decoding programs
3898 need to read from stdin and write to stdout. On some systems,
3899 @command{uudecode -o -} will read stdin and write the decoded file to
3900 stdout, on other systems @command{uudecode -p} does the same thing.
3901 But some systems have uudecode implementations which cannot do this at
3902 all---it is not possible to call these uudecode implementations with
3903 suitable parameters so that they write to stdout.
3905 Of course, this could be circumvented: the @code{begin foo 644} line
3906 could be rewritten to put in some temporary file name, then
3907 @command{uudecode} could be called, then the temp file could be
3908 printed and deleted.
3910 But I have decided that this is too fragile to reliably work, so on some
3911 systems you'll have to do without the uuencode methods.
3913 @item The @value{tramp} file name syntax differs between Emacs and XEmacs.
3915 The Emacs maintainers wish to use a unified file name syntax for
3916 Ange-FTP and @value{tramp} so that users don't have to learn a new
3917 syntax. It is sufficient to learn some extensions to the old syntax.
3919 For the XEmacs maintainers, the problems caused from using a unified
3920 file name syntax are greater than the gains. The XEmacs package system
3921 uses EFS for downloading new packages. So, obviously, EFS has to be
3922 installed from the start. If the file names were unified, @value{tramp}
3923 would have to be installed from the start, too.
3926 @strong{Note:} If you'd like to use a similar syntax like
3927 @value{ftppackagename}, you need the following settings in your init
3931 (setq tramp-unified-filenames t)
3935 The autoload of the @value{emacsname} @value{tramp} package must be
3936 disabled. This can be achieved by setting file permissions @code{000}
3937 to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}.
3939 In case of unified file names, all @value{emacsname} download sites are
3940 added to @code{tramp-default-method-alist} with default method
3941 @option{ftp} @xref{Default Method}. These settings shouldn't be
3942 touched for proper working of the @value{emacsname} package system.
3944 The syntax for unified file names is described in the @value{tramp} manual
3945 for @value{emacsothername}.
3950 @node GNU Free Documentation License
3951 @appendix GNU Free Documentation License
3952 @include doclicense.texi
3955 @node Function Index
3956 @unnumbered Function Index
3960 @node Variable Index
3961 @unnumbered Variable Index
3966 @unnumbered Concept Index
3973 @c * Say something about the .login and .profile files of the remote
3975 @c * Explain how tramp.el works in principle: open a shell on a remote
3976 @c host and then send commands to it.
3977 @c * Consistent small or capitalized words especially in menus.
3978 @c * Make a unique declaration of @trampfn.