Commit 8238a140 authored by Michael Albinus's avatar Michael Albinus
Browse files

* tramp.texi:

* trampver.texi: Migrate to Tramp 2.1.
parent 00d6fd04
2007-07-08 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi:
* trampver.texi: Migrate to Tramp 2.1.
2007-07-02 Carsten Dominik <dominik@science.uva.nl>
* org.texi (Properties): New chapter.
......
......@@ -18,15 +18,27 @@
@include trampver.texi
@c Macros for formatting a filename.
@c trampfn is for a full filename, trampfnmhp means method, host, localname
@c trampfn is for a full filename, trampfnmhl means method, host, localname
@c were given, and so on.
@macro trampfn(method, user, host, localname)
@value{prefix}@value{method}@value{user}@@@value{host}@value{postfix}@value{localname}
@macro trampfn {method, user, host, localname}
@value{prefix}\method\@value{postfixhop}\user\@@\host\@value{postfix}\localname\
@end macro
@macro trampfnmhl {method, host, localname}
@value{prefix}\method\@value{postfixhop}\host\@value{postfix}\localname\
@end macro
@macro trampfnuhl {user, host, localname}
@value{prefix}\user\@@\host\@value{postfix}\localname\
@end macro
@macro trampfnhl {host, localname}
@value{prefix}\host\@value{postfix}\localname\
@end macro
@copying
Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
......@@ -157,6 +169,7 @@ For the developer:
* Version Control:: The inner workings of remote version control.
* Files directories and localnames:: How file names, directories and localnames are mangled and managed.
* Traces and Profiles:: How to Customize Traces.
* Issues:: Debatable Issues and What Was Decided.
* GNU Free Documentation License:: The license for this documentation.
......@@ -178,11 +191,17 @@ Configuring @value{tramp} for use
* Connection types:: Types of connections made to remote machines.
* Inline methods:: Inline methods.
* External transfer methods:: External transfer methods.
* Multi-hop Methods:: Connecting to a remote host using multiple hops.
@ifset emacsgw
* Gateway methods:: Gateway methods.
@end ifset
* Default Method:: Selecting a default method.
* Default User:: Selecting a default user.
* Default Host:: Selecting a default host.
* Multi-hops:: Connecting to a remote host using multiple hops.
* Customizing Methods:: Using Non-Standard Methods.
* Customizing Completion:: Selecting config files for user/host name completion.
* Password caching:: Reusing passwords for several connections.
* Connection caching:: Reusing connection related information.
* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
* Remote shell setup:: Remote shell setup hints.
* Windows setup hints:: Issues with Cygwin ssh.
......@@ -191,10 +210,9 @@ Configuring @value{tramp} for use
Using @value{tramp}
* Filename Syntax:: @value{tramp} filename conventions.
* Multi-hop filename syntax:: Multi-hop filename conventions.
* Alternative Syntax:: URL-like filename syntax.
* Filename completion:: Filename completion.
* Dired:: Dired.
* Compilation:: Compile remote files.
* Remote processes:: Integration with other @value{emacsname} packages (@sc{experimental}).
The inner workings of remote version control
......@@ -220,10 +238,10 @@ How file names, directories and localnames are mangled and managed
@chapter An overview of @value{tramp}
@cindex overview
After the installation of @value{tramp} into your @value{emacsname},
you will be able to access files on remote machines as though they
were local. Access to the remote file system for editing files,
version control, and @code{dired} are transparently enabled.
After the installation of @value{tramp} into your @value{emacsname}, you
will be able to access files on remote machines as though they were
local. Access to the remote file system for editing files, version
control, and @code{dired} are transparently enabled.
Your access to the remote machine can be with the @command{rsh},
@command{rlogin}, @command{telnet} programs or with any similar
......@@ -380,7 +398,7 @@ behind the scenes when you open a file with @value{tramp}.
@value{tramp} is freely available on the Internet and the latest
release may be downloaded from
@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full
@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full
documentation and code for @value{tramp}, suitable for installation.
But GNU Emacs (22 or later) includes @value{tramp} already, and there
is a @value{tramp} package for XEmacs, as well. So maybe it is easier
......@@ -389,7 +407,7 @@ on@dots{...}
For the especially brave, @value{tramp} is available from CVS. The CVS
version is the latest version of the code and may contain incomplete
features or new issues. Use these versions at your own risk.
features or new issues. Use these versions at your own risk.
Instructions for obtaining the latest development version of @value{tramp}
from CVS can be found by going to the Savannah project page at the
......@@ -410,7 +428,7 @@ Or follow the example session below:
@noindent
You should now have a directory @file{~/@value{emacsdir}/tramp}
containing the latest version of @value{tramp}. You can fetch the latest
containing the latest version of @value{tramp}. You can fetch the latest
updates from the repository by issuing the command:
@example
......@@ -429,6 +447,11 @@ script:
] @strong{autoconf}
@end example
People who have no direct CVS access (maybe because sitting behind a
blocking firewall), can try the
@uref{http://savannah.gnu.org/cvs-backup/tramp-sources.tar.gz, Nightly
CVS Tree Tarball} instead of.
@node History
@chapter History of @value{tramp}
......@@ -445,7 +468,19 @@ file contents were added. Support for VC was added.
The most recent addition of major features were the multi-hop methods
added in April 2000 and the unification of @value{tramp} and Ange-FTP
filenames in July 2002.
filenames in July 2002. In July 2004, multi-hop methods have been
replaced by proxy hosts. Running commands on remote hosts was
introduced in December 2005.
@ifset emacsgw
Support of gateways exists since April 2007.
@end ifset
In December 2001, @value{tramp} has been added to the XEmacs package
repository. Being part of the GNU Emacs repository happened in June
2002, the first release including @value{tramp} was GNU Emacs 22.1.
@value{tramp} is also a GNU/Linux Debian package since February 2001.
@c Installation chapter is necessary only in case of standalone
@c installation. Text taken from trampinst.texi.
......@@ -462,7 +497,7 @@ filenames in July 2002.
installed. It is initially configured to use the @command{scp}
program to connect to the remote host. So in the easiest case, you
just type @kbd{C-x C-f} and then enter the filename
@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}.
@file{@trampfnuhl{user, machine, /path/to.file}}.
On some hosts, there are problems with opening a connection. These are
related to the behavior of the remote shell. See @xref{Remote shell
......@@ -482,14 +517,20 @@ Method}.
* Connection types:: Types of connections made to remote machines.
* Inline methods:: Inline methods.
* External transfer methods:: External transfer methods.
* Multi-hop Methods:: Connecting to a remote host using multiple hops.
@ifset emacsgw
* Gateway methods:: Gateway methods.
@end ifset
* Default Method:: Selecting a default method.
Here we also try to help those who
don't have the foggiest which method
is right for them.
* Default User:: Selecting a default user.
* Default Host:: Selecting a default host.
* Multi-hops:: Connecting to a remote host using multiple hops.
* Customizing Methods:: Using Non-Standard Methods.
* Customizing Completion:: Selecting config files for user/host name completion.
* Password caching:: Reusing passwords for several connections.
* Connection caching:: Reusing connection related information.
* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
* Remote shell setup:: Remote shell setup hints.
* Windows setup hints:: Issues with Cygwin ssh.
......@@ -508,7 +549,7 @@ remote shell access program such as @command{rsh}, @command{ssh} or
This connection is used to perform many of the operations that @value{tramp}
requires to make the remote file system transparently accessible from
the local machine. It is only when visiting files that the methods
the local machine. It is only when visiting files that the methods
differ.
@cindex inline methods
......@@ -519,7 +560,7 @@ differ.
@cindex methods, external transfer
@cindex methods, out-of-band
Loading or saving a remote file requires that the content of the file
be transfered between the two machines. The content of the file can be
be transfered between the two machines. The content of the file can be
transfered over the same connection used to log in to the remote
machine or the file can be transfered through another connection using
a remote copy program such as @command{rcp}, @command{scp} or
......@@ -539,16 +580,10 @@ startup may drown out the improvement in file transfer times.
External transfer methods should be configured such a way that they
don't require a password (with @command{ssh-agent}, or such alike).
If it isn't possible, you should consider @ref{Password caching},
otherwise you will be prompted for a password every copy action.
@cindex multi-hop methods
@cindex methods, multi-hop
A variant of the inline methods are the @dfn{multi-hop methods}.
These methods allow you to connect a remote host using a number `hops',
each of which connects to a different host. This is useful if you are
in a secured network where you need to go through a bastion host to
connect to the outside world.
Modern @command{scp} implementations offer options to reuse existing
@command{ssh} connections, see method @command{scpc}. If it isn't
possible, you should consider @ref{Password caching}, otherwise you
will be prompted for a password every copy action.
@node Inline methods
......@@ -635,6 +670,8 @@ as the @option{rsh} method.
This method does not connect to a remote host at all, rather it uses
the @command{su} program to allow you to edit files as another user.
With other words, a specified host name in the file name is silently
ignored.
@item @option{sudo}
......@@ -682,7 +719,7 @@ This supports the @samp{-p} kludge.
@item @option{krlogin}
@cindex method krlogin
@cindex km krlogin
@cindex krlogin method
@cindex Kerberos (with krlogin method)
This method is also similar to @option{ssh}. It only uses the
......@@ -697,18 +734,43 @@ This method is mostly interesting for Windows users using the PuTTY
implementation of SSH. It uses @samp{plink -ssh} to log in to the
remote host.
Additionally, the method @option{plink1} is provided, which calls
@samp{plink -1 -ssh} in order to use SSH protocol version 1
explicitly.
This supports the @samp{-P} kludge.
Additionally, the methods @option{plink1} and @option{plink2} are
provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in
order to use SSH protocol version 1 or 2 explicitly.
CCC: Do we have to connect to the remote host once from the command
line to accept the SSH key? Maybe this can be made automatic?
CCC: Does @command{plink} support the @samp{-p} option? @value{tramp} will
support that, anyway.
CCC: Say something about the first shell command failing. This might
be due to a wrong setting of @code{tramp-rsh-end-of-line}.
@end table
@item @option{plinkx}
@cindex method plinkx
@cindex plinkx method
Another method using PuTTY on Windows. Instead of host names, it
expects PuTTY session names, calling @samp{plink -load @var{session}
-t"}. User names are relevant only in case the corresponding session
hasn't defined a user name. Different port numbers must be defined in
the session.
@item @option{fish}
@cindex method fish
@cindex fish method
This is an experimental implementation of the fish protocol, known from
the GNU Midnight Commander or the KDE Konqueror. @value{tramp} expects
the fish server implementation from the KDE kioslave. That means, the
file @file{~/.fishsrv.pl} is expected to reside on the remote host.
The implementation lacks good performance. The code is offered anyway,
maybe somebody can improve the performance.
@end table
@node External transfer methods
......@@ -725,21 +787,10 @@ transfers to an external transfer utility.
This saves the overhead of encoding and decoding that multiplexing the
transfer through the one connection has with the inline methods.
If you want to use an external transfer method you should be able to
execute the transfer utility to copy files to and from the remote
machine without any interaction.
@cindex ssh-agent
This means that you will need to use @command{ssh-agent} if you use the
@command{scp} program for transfers, or maybe your version of
@command{scp} accepts a password on the command line.@footnote{PuTTY's
@command{pscp} allows you to specify the password on the command line.}
If you use @command{rsync} via @command{ssh} then the same rule must
apply to that connection.
If you cannot get an external method to run without asking for a
password you should consider @ref{Password caching}.
Since external transfer methods need their own overhead opening a new
channel, all files which are smaller than @var{tramp-copy-size-limit}
are still transferred with the corresponding inline method. It should
provide a fair trade-off between both approaches.
@table @asis
@item @option{rcp} --- @command{rsh} and @command{rcp}
......@@ -767,7 +818,7 @@ Using @command{ssh} to connect to the remote host and @command{scp} to
transfer files between the machines is the best method for securely
connecting to a remote machine and accessing files.
The performance of this option is also quite good. It may be slower than
The performance of this option is also quite good. It may be slower than
the inline methods when you often open and close small files however.
The cost of the cryptographic handshake at the start of an @command{scp}
session can begin to absorb the advantage that the lack of encoding and
......@@ -787,7 +838,24 @@ know what these are, you do not need these options.
All the @command{ssh} based methods support the kludgy @samp{-p}
feature where you can specify a port number to connect to in the host
name. For example, the host name @file{host#42} tells @value{tramp} to
specify @samp{-p 42} in the argument list for @command{ssh}.
specify @samp{-p 42} in the argument list for @command{ssh}, and to
specify @samp{-P 42} in the argument list for @command{scp}.
@item @option{sftp} --- @command{ssh} and @command{sftp}
@cindex method sftp
@cindex sftp method
@cindex sftp (with sftp method)
@cindex ssh (with sftp method)
That is mostly the same method as @option{scp}, but using
@command{sftp} as transfer command. So the same remarks are valid.
This command does not work like @value{ftppackagename}, where
@command{ftp} is called interactively, and all commands are send from
within this session. Instead of, @command{ssh} is used for login.
This method supports the @samp{-p} hack.
@item @option{rsync} --- @command{ssh} and @command{rsync}
......@@ -805,7 +873,7 @@ transferring files that exist on both hosts, this advantage is lost if
the file exists only on one side of the connection.
The @command{rsync} based method may be considerably faster than the
@command{rcp} based methods when writing to the remote system. Reading
@command{rcp} based methods when writing to the remote system. Reading
files to the local machine is no faster than with a direct copy.
This method supports the @samp{-p} hack.
......@@ -866,7 +934,22 @@ This method is similar to @option{scp}, but it uses the
@command{pscp} for transferring the files. These programs are part
of PuTTY, an SSH implementation for Windows.
CCC: Does @command{plink} support the @samp{-p} hack?
This method supports the @samp{-P} hack.
@item @option{psftp} --- @command{plink} and @command{psftp}
@cindex method psftp
@cindex psftp method
@cindex psftp (with psftp method)
@cindex plink (with psftp method)
@cindex PuTTY (with psftp method)
As you would expect, this method is similar to @option{sftp}, but it
uses the @command{plink} command to connect to the remote host, and it
uses @command{psftp} for transferring the files. These programs are
part of PuTTY, an SSH implementation for Windows.
This method supports the @samp{-P} hack.
@item @option{fcp} --- @command{fsh} and @command{fcp}
......@@ -901,7 +984,7 @@ anyway.
@cindex method ftp
@cindex ftp method
This is not a native @value{tramp} method. Instead of, it forwards all
This is not a native @value{tramp} method. Instead of, it forwards all
requests to @value{ftppackagename}.
@ifset xemacs
This works only for unified filenames, see @ref{Issues}.
......@@ -935,8 +1018,15 @@ specify a user name which looks like @code{user%domain} (the real user
name, then a percent sign, then the domain name). So, to connect to
the machine @code{melancholia} as user @code{daniel} of the domain
@code{BIZARRE}, and edit @file{.emacs} in the home directory (share
@code{daniel$}) I would specify the filename
@file{@value{prefix}smb@value{postfixsinglehop}daniel%BIZARRE@@melancholia@value{postfix}/daniel$$/.emacs}.
@code{daniel$}) I would specify the filename @file{@trampfn{smb,
daniel%BIZARRE, melancholia, /daniel$$/.emacs}}.
Depending on the Windows domain configuration, a Windows user might be
considered as domain user per default. In order to connect as local
user, the WINS name of that machine must be given as domain name.
Usually, it is the machine name in capital letters. In the example
above, the local user @code{daniel} would be specified as
@file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}.
The domain name as well as the user name are optional. If no user
name is specified at all, the anonymous user (without password
......@@ -953,97 +1043,56 @@ name.
@end table
@node Multi-hop Methods
@section Connecting to a remote host using multiple hops
@cindex multi-hop methods
@cindex methods, multi-hop
Sometimes, the methods described before are not sufficient. Sometimes,
it is not possible to connect to a remote host using a simple command.
For example, if you are in a secured network, you might have to log in
to a `bastion host' first before you can connect to the outside world.
Of course, the target host may also require a bastion host. The format
of multi-hop filenames is slightly different than the format of normal
@value{tramp} methods.
@cindex method multi
@cindex multi method
A multi-hop file name specifies a method, a number of hops, and a
localname (path name on the remote system). The method name is always
@option{multi}.
Each hop consists of a @dfn{hop method} specification, a user name and
a host name. The hop method can be an inline method only. The
following hop methods are (currently) available:
@table @option
@item telnet
@cindex hop method telnet
@cindex telnet hop method
Uses the well-known @command{telnet} program to connect to the host.
Whereas user name and host name are supplied in the file name, the
user is queried for the password.
@item rsh
@cindex hop method rsh
@cindex rsh hop method
This uses @command{rsh} to connect to the host. You do not need to
enter a password unless @command{rsh} explicitly asks for it.
The variant @option{remsh} uses the @command{remsh} command. It
should be applied on machines where @command{remsh} is used instead of
@command{rsh}.
@item ssh
@cindex hop method ssh
@cindex ssh hop method
This uses @command{ssh} to connect to the host. You might have to enter
a password or a pass phrase.
@item su
@cindex hop method su
@cindex su hop method
This method does not actually contact a different host, but it allows
you to become a different user on the host you're currently on. This
might be useful if you want to edit files as root, but the remote host
does not allow remote root logins. In this case you can use
@option{telnet}, @option{rsh} or @option{ssh} to connect to the
remote host as a non-root user, then use an @option{su} hop to become
root. But @option{su} need not be the last hop in a sequence, you could
also use it somewhere in the middle, if the need arises.
Even though you @emph{must} specify both user and host with an
@option{su} hop, the host name is ignored and only the user name is
used.
@item sudo
@cindex hop method sudo
@cindex sudo hop method
This is similar to the @option{su} hop, except that it uses
@command{sudo} rather than @command{su} to become a different user.
@ifset emacsgw
@node Gateway methods
@section Gateway methods
@cindex methods, gateway
@cindex gateway methods
@end table
Gateway methods are not methods to access a remote host directly.
These methods are intended to pass firewalls or proxy servers.
Therefore, they can be used for proxy host declarations
(@pxref{Multi-hops}) only.
Some people might wish to use port forwarding with @command{ssh} or
maybe they have to use a nonstandard port. This can be accomplished
by putting a stanza in @file{~/.ssh/config} for the account which
specifies a different port number for a certain host name. But it can
also be accomplished within @value{tramp}, by adding a multi-hop method.
For example:
A gateway method must come always along with a method who supports
port setting (referred to as @samp{-p} kludge). This is because
@value{tramp} targets the accompanied method to
@file{localhost#random_port}, from where the firewall or proxy server
is accessed to.
@lisp
(add-to-list
'tramp-multi-connection-function-alist
'("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n"))
@end lisp
Gateway methods support user name and password declarations. These
are used to authenticate towards the corresponding firewall or proxy
server. They can be passed only if your friendly administrator has
granted your access.
@table @asis
@item @option{tunnel}
@cindex method tunnel
@cindex tunnel method
This method implements an HTTP tunnel via the @command{CONNECT}
command (see RFC 2616, 2817). Any HTTP 1.1 compliant (proxy) server
shall support this command.
As authentication method, only @option{Basic Authentication} (see RFC
2617) is implemented so far. If no port number is given in the
declaration, port @option{8080} is used for the proxy server.
@item @option{socks}
@cindex method socks
@cindex socks method
Now you can use an @option{sshf} hop which connects to port 4400 instead of
the standard port.
The @command{socks} method provides access to SOCKSv5 servers (see
RFC 1928). @option{Username/Password Authentication} according to RFC
1929 is supported.
The default port number of the socks server is @option{1080}, if not
specified otherwise.
@end table
@end ifset
@node Default Method
......@@ -1085,7 +1134,6 @@ methods, giving better performance.
@xref{Inline methods}.
@xref{External transfer methods}.
@xref{Multi-hop Methods}.
Another consideration with the selection of transfer methods is the
environment you will use them in and, especially when used over the
......@@ -1098,7 +1146,7 @@ read from other machines.
If you need to connect to remote systems that are accessible from the
Internet, you should give serious thought to using @option{ssh} based
methods to connect. These provide a much higher level of security,
methods to connect. These provide a much higher level of security,
making it a non-trivial exercise for someone to obtain your password
or read the content of the files you are editing.
......@@ -1119,9 +1167,9 @@ to edit mostly small files.
I guess that these days, most people can access a remote machine by
using @command{ssh}. So I suggest that you use the @option{ssh}
method. So, type @kbd{C-x C-f
@value{prefix}ssh@value{postfixsinglehop}root@@otherhost@value{postfix}/etc/motd
@key{RET}} to edit the @file{/etc/motd} file on the other host.
method. So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost,
/etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other
host.
If you can't use @option{ssh} to log in to the remote host, then
select a method that uses a program that works. For instance, Windows
......@@ -1132,9 +1180,9 @@ implementation of @command{ssh}. Or you use Kerberos and thus like
For the special case of editing files on the local host as another
user, see the @option{su} or @option{sudo} methods. They offer
shortened syntax for the @samp{root} account, like
@file{@value{prefix}su@value{postfixsinglehop}@value{postfix}/etc/motd}.
@file{@trampfnmhl{su, , /etc/motd}}.
People who edit large files may want to consider @option{scp} instead
People who edit large files may want to consider @option{scpc} instead
of @option{ssh}, or @option{pscp} instead of @option{plink}. These
out-of-band methods are faster than inline methods for large files.
Note, however, that out-of-band methods suffer from some limitations.
......@@ -1143,6 +1191,205 @@ from using an out-of-band method! Maybe even for large files, inline
methods are fast enough.
@node Default User
@section Selecting a default user
@cindex default user
The user part of a @value{tramp} file name can be omitted. Usually,
it is replaced by the user name you are logged in. Often, this is not
what you want. A typical use of @value{tramp} might be to edit some
files with root permissions on the local host. This case, you should
set the variable @code{tramp-default-user} to reflect that choice.
For example:
@lisp
(setq tramp-default-user "root")
@end lisp
@code{tramp-default-user} is regarded as obsolete, and will be removed
soon.
@vindex tramp-default-user-alist
You can also specify different users for certain method/host
combinations, via the variable @code{tramp-default-user-alist}. For
example, if you always have to use the user @samp{john} in the domain
@samp{somewhere.else}, you can specify the following:
@lisp
(add-to-list 'tramp-default-user-alist
'("ssh" ".*\\.somewhere\\.else\\'" "john"))
@end lisp
@noindent
See the documentation for the variable
@code{tramp-default-user-alist} for more details.
One trap to fall in must be known. If @value{tramp} finds a default
user, this user will be passed always to the connection command as
parameter (for example @samp{ssh here.somewhere.else -l john}. If you
have specified another user for your command in its configuration
files, @value{tramp} cannot know it, and the remote access will fail.
If you have specified in the given example in @file{~/.ssh/config} the
lines
@example
Host here.somewhere.else
User lily
@end example
@noindent
than you must discard selecting a default user by @value{tramp}. This
will be done by setting it to @code{nil} (or @samp{lily}, likewise):
@lisp
(add-to-list 'tramp-default-user-alist
'("ssh" "\\`here\\.somewhere\\.else\\'" nil))
@end lisp
The last entry in @code{tramp-default-user-alist} could be your
default user you'll apply predominantly. You shall @emph{append} it
to that list at the end:
@lisp
(add-to-list 'tramp-default-user-alist '(nil nil "jonas") t)
@end lisp