tramp.texi 84.2 KB
Newer Older
Kai Großjohann's avatar
Kai Großjohann committed
1 2
\input texinfo   @c -*-texinfo-*-
@c %**start of header
David Kastrup's avatar
David Kastrup committed
3
@setfilename ../info/tramp
Kai Großjohann's avatar
Kai Großjohann committed
4 5 6 7 8 9 10
@settitle TRAMP User Manual
@setchapternewpage odd
@c %**end of header

@c This is *so* much nicer :)
@footnotestyle end

11 12 13 14
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
@include trampver.texi
Kai Großjohann's avatar
Kai Großjohann committed
15 16

@c Entries for @command{install-info} to use
17
@dircategory Emacs
Kai Großjohann's avatar
Kai Großjohann committed
18 19 20 21 22 23 24 25 26 27
@direntry
* TRAMP: (tramp).                Transparent Remote Access, Multiple Protocol
                                 Emacs remote file access via rsh and rcp.
@end direntry

@c Macro to make formatting of the tramp program name consistent.
@macro tramp
@sc{tramp}
@end macro

28
@c Some flags which make the text independent on the (X)Emacs flavor.
29 30
@c "emacs" resp "xemacs" are set in the Makefile.

31 32
@c GNU Emacs values.
@ifset emacs
33
@set emacs-name               GNU Emacs
34
@set emacs-dir                emacs
35 36 37
@set emacs-other-name         XEmacs
@set emacs-other-dir          xemacs
@set emacs-other-file-name    tramp-xemacs.html
38 39 40 41 42 43 44 45 46 47 48 49
@set ftp-package-name         Ange-FTP
@set tramp-prefix             /
@set tramp-prefix-single-hop
@set tramp-postfix            :
@set tramp-postfix-single-hop :
@set tramp-postfix-multi-hop  :
@end ifset

@c XEmacs counterparts.
@ifset xemacs
@set emacs-name               XEmacs
@set emacs-dir                xemacs
50 51 52
@set emacs-other-name         GNU Emacs
@set emacs-other-dir          emacs
@set emacs-other-file-name    tramp-emacs.html
53 54 55 56 57 58 59 60 61
@set ftp-package-name         EFS
@set tramp-prefix             /[
@set tramp-prefix-single-hop  [
@set tramp-postfix            ]
@set tramp-postfix-single-hop /
@set tramp-postfix-multi-hop  :
@end ifset

@c Macros for formatting a filename.
Kai Großjohann's avatar
Kai Großjohann committed
62
@c trampfn is for a full filename, trampfnmhp means method, host, localname
63
@c were given, and so on.
Kai Großjohann's avatar
Kai Großjohann committed
64 65
@macro trampfn(method, user, host, localname)
@value{tramp-prefix}@value{method}@value{user}@@@value{host}@value{tramp-postfix}@value{localname}
66
@end macro
Kai Großjohann's avatar
Kai Großjohann committed
67

68
@copying
69
Copyright @copyright{} 1999, 2000, 2001, 2002, 2003 Free Software
70 71
Foundation, Inc.

Kai Großjohann's avatar
Kai Großjohann committed
72
@quotation     
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU
Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
license is included in the section entitled ``GNU Free Documentation
License'' in the Emacs manual.

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development.''

This document is part of a collection distributed under the GNU Free
Documentation License.  If you want to distribute this document
separately from the collection, you can do so by adding a copy of the
license to the document, as described in section 6 of the license.
@end quotation
@end copying

Kai Großjohann's avatar
Kai Großjohann committed
92 93 94
@tex

@titlepage
95
@title @tramp{} version @trampver{} User Manual
Kai Großjohann's avatar
Kai Großjohann committed
96 97 98

@author by Daniel Pittman
@author based on documentation by Kai Gro@ss{}johann
99

Kai Großjohann's avatar
Kai Großjohann committed
100
@page
101
@insertcopying
Kai Großjohann's avatar
Kai Großjohann committed
102 103 104 105 106 107 108

@end titlepage
@page

@end tex

@ifnottex
109
@node Top, Overview, (dir), (dir)
110 111 112 113
@top @tramp{} version @trampver{} User Manual

This file documents @tramp{} version @trampver{}, a remote file
editing package for @value{emacs-name}.
Kai Großjohann's avatar
Kai Großjohann committed
114 115 116

@tramp{} stands for `Transparent Remote (file) Access, Multiple
Protocol'.  This package provides remote file editing, similar to
117
@value{ftp-package-name}.
Kai Großjohann's avatar
Kai Großjohann committed
118

119 120 121 122
The difference is that @value{ftp-package-name} uses FTP to transfer
files between the local and the remote host, whereas @tramp{} uses a
combination of @command{rsh} and @command{rcp} or other work-alike
programs, such as @command{ssh}/@command{scp}.
Kai Großjohann's avatar
Kai Großjohann committed
123 124 125 126

You can find the latest version of this document on the web at
@uref{http://www.freesoftware.fsf.org/tramp/}.

127 128 129 130 131 132 133 134 135 136
The manual has been generated for @value{emacs-name}.
@ifinfo
If you want to read the info pages for @value{emacs-other-name}, you
should read in @ref{Installation} how to create them.
@end ifinfo
@ifhtml
If you're using the other Emacs flavour, you should read the
@uref{@value{emacs-other-file-name}, @value{emacs-other-name}} pages.
@end ifhtml

Kai Großjohann's avatar
Kai Großjohann committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
@ifhtml
This manual is also available as a @uref{tramp_ja.html, Japanese
translation}.

The latest release of @tramp{} is available for
@uref{http://savannah.gnu.org/download/tramp/,
download}, or you may see @ref{Obtaining @tramp{}} for more details,
including the CVS server details.

@tramp{} also has a @uref{https://savannah.gnu.org/projects/tramp/,
Savannah Project Page}.
@end ifhtml

There is a mailing list for @tramp{}, available at
@email{tramp-devel@@mail.freesoftware.fsf.org}, and archived at
@uref{http://www.mail-archive.com/emacs-rcp@@ls6.cs.uni-dortmund.de/} as
well as the usual Savannah archives.

155 156
@insertcopying

Kai Großjohann's avatar
Kai Großjohann committed
157 158 159 160 161 162
@end ifnottex

@menu
* Overview::                    What @tramp{} can and cannot do.

For the end user:
163
* Obtaining @tramp{}::             How to obtain @tramp{}.
164 165
* History::                     History of @tramp{}.
* Installation::                Installing @tramp{} with your @value{emacs-name}.
Kai Großjohann's avatar
Kai Großjohann committed
166 167
* Configuration::               Configuring @tramp{} for use.
* Usage::                       An overview of the operation of @tramp{}.
168
* Bug Reports::                 Reporting Bugs and Problems.
Kai Großjohann's avatar
Kai Großjohann committed
169 170 171 172
* Frequently Asked Questions::  Questions and answers from the mailing list.

For the developer:
* Version Control::             The inner workings of remote version control.
Kai Großjohann's avatar
Kai Großjohann committed
173
* Files directories and localnames::  How file names, directories and localnames are mangled and managed.
174
* Issues::                      Debatable Issues and What Was Decided.
Kai Großjohann's avatar
Kai Großjohann committed
175 176 177 178 179 180 181 182 183 184 185 186

@detailmenu
 --- The Detailed Node Listing ---

Configuring @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.
* Default Method::              Selecting a default method.
* Customizing Methods::         Using Non-Standard Methods.
187
* Customizing Completion::      Selecting config files for user/host name completion.
Kai Großjohann's avatar
Kai Großjohann committed
188
* Remote Programs::             How @tramp{} finds and uses programs on the remote machine.
189 190
* Remote shell setup::          Remote shell setup hints.
* Windows setup hints::         Issues with Cygwin ssh.
191
* Auto-save and Backup::        Auto-save and Backup.
Kai Großjohann's avatar
Kai Großjohann committed
192 193 194 195

Using @tramp

* Filename Syntax::             @tramp{} filename conventions.
196 197 198
* Multi-hop filename syntax::   Multi-hop filename conventions.
* Filename completion::         Filename completion.
* Dired::                       Dired.
Kai Großjohann's avatar
Kai Großjohann committed
199 200 201 202 203 204 205

The inner workings of remote version control

* Version Controlled Files::    Determining if a file is under version control.
* Remote Commands::             Executing the version control commands on the remote machine.
* Changed workfiles::           Detecting if the working file has changed.
* Checking out files::          Bringing the workfile out of the repository.
206
* Miscellaneous Version Control::  Things related to Version Control that don't fit elsewhere.
Kai Großjohann's avatar
Kai Großjohann committed
207 208 209 210 211 212

Things related to Version Control that don't fit elsewhere

* Remote File Ownership::       How VC determines who owns a workfile.
* Back-end Versions::           How VC determines what release your RCS is.

Kai Großjohann's avatar
Kai Großjohann committed
213
How file names, directories and localnames are mangled and managed.
Kai Großjohann's avatar
Kai Großjohann committed
214

215
* Localname deconstruction::    Breaking a localname into its components.
Kai Großjohann's avatar
Kai Großjohann committed
216 217 218 219 220 221

@end detailmenu
@end menu

@node Overview
@chapter An overview of @tramp
222
@cindex overview
Kai Großjohann's avatar
Kai Großjohann committed
223

224 225 226 227
After the installation of @tramp{} into your @value{emacs-name}, 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 @command{dired} are transparently enabled.
Kai Großjohann's avatar
Kai Großjohann committed
228 229 230

Your access to the remote machine can be with the @command{rsh},
@command{rlogin}, @command{telnet} programs or with any similar
231
connection method.  This connection must pass ASCII successfully to be
Kai Großjohann's avatar
Kai Großjohann committed
232 233 234
usable but need not be 8-bit clean.

The package provides support for @command{ssh} connections out of the
235 236 237
box, one of the more common uses of the package.  This allows
relatively secure access to machines, especially if @command{ftp}
access is disabled.
Kai Großjohann's avatar
Kai Großjohann committed
238

239 240 241 242
The majority of activity carried out by @tramp{} requires only that
the remote login is possible and is carried out at the terminal.  In
order to access remote files @tramp{} needs to transfer their content
to the local machine temporarily.
Kai Großjohann's avatar
Kai Großjohann committed
243

244 245 246
@tramp{} can transfer files between the machines in a variety of ways.
The details are easy to select, depending on your needs and the
machines in question.
Kai Großjohann's avatar
Kai Großjohann committed
247

248 249 250 251
The fastest transfer methods (for large files) rely on a remote file
transfer package such as @command{rcp}, @command{scp} or
@command{rsync}.  The use of these methods is only possible if the
file copy command does not ask for a password for the remote machine.
Kai Großjohann's avatar
Kai Großjohann committed
252 253

If the remote copy methods are not suitable for you, @tramp{} also
254 255 256 257
supports the use of encoded transfers directly through the shell.
This requires that the @command{mimencode} or @command{uuencode} tools
are available on the remote machine.  These methods are generally
faster for small files.
Kai Großjohann's avatar
Kai Großjohann committed
258

259 260 261 262
Within these limitations, @tramp{} is quite powerful.  It is worth
noting that, as of the time of writing, it is far from a polished
end-user product.  For a while yet you should expect to run into rough
edges and problems with the code now and then.
Kai Großjohann's avatar
Kai Großjohann committed
263 264 265 266 267 268 269 270 271 272 273

It is finished enough that the developers use it for day to day work but
the installation and setup can be a little difficult to master, as can
the terminology.

@tramp{} is still under active development and any problems you encounter,
trivial or major, should be reported to the @tramp{} developers.
@xref{Bug Reports}.


@subsubheading Behind the scenes
274
@cindex behind the scenes
Kai Großjohann's avatar
Kai Großjohann committed
275 276
@cindex details of operation
@cindex how it works
Kai Großjohann's avatar
Kai Großjohann committed
277 278 279 280 281 282 283 284 285 286 287

This section tries to explain what goes on behind the scenes when you
access a remote file through @tramp{}.

Suppose you type @kbd{C-x C-f} and enter part of an @tramp{} file name,
then hit @kbd{@key{TAB}} for completion.  Suppose further that this is
the first time that @tramp{} is invoked for the host in question.  Here's
what happens:

@itemize
@item
288 289 290
@tramp{} discovers that it needs a connection to the host.  So it
invokes @samp{telnet @var{host}} or @samp{rsh @var{host} -l
@var{user}} or a similar tool to connect to the remote host.
291 292 293
Communication with this process happens through an
@value{emacs-name} buffer, that is, the output from the remote end
goes into a buffer.
Kai Großjohann's avatar
Kai Großjohann committed
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316

@item
The remote host may prompt for a login name (for @command{telnet}).  The
login name is given in the file name, so @tramp{} sends the login name and
a newline.

@item
The remote host may prompt for a password or pass phrase (for
@command{rsh} or for @command{telnet} after sending the login name).
@tramp{} displays the prompt in the minibuffer, asking you for the
password or pass phrase.

You enter the password or pass phrase.  @tramp{} sends it to the remote
host, followed by a newline.

@item
@tramp{} now waits for the shell prompt or for a message that the login
failed.

If @tramp{} sees neither of them after a certain period of time (a minute,
say), then it issues an error message saying that it couldn't find the
remote shell prompt and shows you what the remote host has sent.

317 318
If @tramp{} sees a @samp{login failed} message, it tells you so,
aborts the login attempt and allows you to try again.
Kai Großjohann's avatar
Kai Großjohann committed
319 320 321 322 323 324

@item
Suppose that the login was successful and @tramp{} sees the shell prompt
from the remote host.  Now @tramp{} invokes @command{/bin/sh} because
Bourne shells and C shells have different command
syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login
325
shell doesn't recognize @samp{exec /bin/sh} as a valid command.
Kai Großjohann's avatar
Kai Großjohann committed
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
Maybe you use the Scheme shell @command{scsh}@dots{}}

After the Bourne shell has come up, @tramp{} sends a few commands to
ensure a good working environment.  It turns off echoing, it sets the
shell prompt, and a few other things.

@item
Now the remote shell is up and it good working order.  Remember, what
was supposed to happen is that @tramp{} tries to find out what files exist
on the remote host so that it can do filename completion.

So, @tramp{} basically issues @command{cd} and @command{ls} commands and
also sometimes @command{echo} with globbing.  Another command that is
often used is @command{test} to find out whether a file is writable or a
directory or the like.  The output of each command is parsed for the
necessary operation.

@item
Suppose you are finished with filename completion, have entered @kbd{C-x
C-f}, a full file name and hit @kbd{@key{RET}}.  Now comes the time to
transfer the file contents from the remote host to the local host so
that you can edit them.

See above for an explanation of how @tramp{} transfers the file contents.

351
For inline transfers, @tramp{} issues a command like @samp{mimencode -b
Kai Großjohann's avatar
Kai Großjohann committed
352 353 354 355
/path/to/remote/file}, waits until the output has accumulated in the
buffer that's used for communication, then decodes that output to
produce the file contents.

356 357 358 359 360 361
For out-of-band transfers, @tramp{} issues a command like the following:
@example
rcp user@@host:/path/to/remote/file /tmp/tramp.4711
@end example
It then reads the local temporary file @file{/tmp/tramp.4711} into a
buffer and deletes the temporary file.
Kai Großjohann's avatar
Kai Großjohann committed
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381

@item
You now edit the buffer contents, blithely unaware of what has happened
behind the scenes.  (Unless you have read this section, that is.)  When
you are finished, you type @kbd{C-x C-s} to save the buffer.

@item
Again, @tramp{} transfers the file contents to the remote host either
inline or out-of-band.  This is the reverse of what happens when reading
the file.

@end itemize

I hope this has provided you with a basic overview of what happens
behind the scenes when you open a file with @tramp{}.


@c For the end user
@node Obtaining @tramp{}
@chapter Obtaining @tramp{}.
382
@cindex obtaining Tramp
Kai Großjohann's avatar
Kai Großjohann committed
383

384 385 386 387 388 389 390
@tramp{} is freely available on the Internet and the latest release
may be downloaded from
@uref{http://savannah.nongnu.org/download/tramp/}. This
release includes the full documentation and code for @tramp{},
suitable for installation.  But Emacs (21.4 or later) includes
@tramp{} already, and there is a @tramp{} package for XEmacs, as well.
So maybe it is easier to just use those.  But if you want the bleeding
391
edge, read on@dots{...}
Kai Großjohann's avatar
Kai Großjohann committed
392

393 394 395
For the especially brave, @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.
Kai Großjohann's avatar
Kai Großjohann committed
396 397

Instructions for obtaining the latest development version of @tramp{}
398
from CVS can be found by going to the Savannah project page at the
399 400
following URL and then clicking on the CVS link in the navigation bar
at the top.
401 402 403 404 405 406

@noindent
@uref{http://savannah.gnu.org/projects/tramp/}

@noindent
Or follow the example session below:
Kai Großjohann's avatar
Kai Großjohann committed
407 408

@example
409
] @strong{cd ~/@value{emacs-dir}}
Kai Großjohann's avatar
Kai Großjohann committed
410 411 412 413 414 415 416 417 418
] @strong{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/tramp login}

(Logging in to anoncvs@@subversions.gnu.org)
CVS password: @strong{(just hit RET here)}
@dots{}

] @strong{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/tramp co tramp}
@end example

419
@noindent
420 421 422
You should now have a directory @file{~/@value{emacs-dir}/tramp}
containing the latest version of @tramp{}. You can fetch the latest
updates from the repository by issuing the command:
Kai Großjohann's avatar
Kai Großjohann committed
423 424

@example
425
] @strong{cd ~/@value{emacs-dir}/tramp}
Kai Großjohann's avatar
Kai Großjohann committed
426 427 428
] @strong{cvs update -d}
@end example

429 430 431 432 433 434 435 436 437 438
@noindent
Once you've got updated files from the CVS repository, you need to run
@command{autoconf} in order to get an up-to-date @file{configure}
script:

@example
] @strong{cd ~/@value{emacs-dir}/tramp}
] @strong{autoconf}
@end example

Kai Großjohann's avatar
Kai Großjohann committed
439 440 441

@node History
@chapter History of @tramp{}
442 443
@cindex history
@cindex development history
Kai Großjohann's avatar
Kai Großjohann committed
444 445

Development was started end of November 1998.  The package was called
446 447 448 449 450 451
@file{rssh.el}, back then.  It only provided one method to access a
file, using @command{ssh} to log in to a remote host and using
@command{scp} to transfer the file contents.  After a while, the name
was changed to @file{rcp.el}, and now it's @tramp{}.  Along the way,
many more methods for getting a remote shell and for transferring the
file contents were added.  Support for VC was added.
Kai Großjohann's avatar
Kai Großjohann committed
452

453 454 455
The most recent addition of major features were the multi-hop methods
added in April 2000 and the unification of @tramp{} and Ange-FTP
filenames in July 2002.
Kai Großjohann's avatar
Kai Großjohann committed
456 457 458


@node Installation
459
@chapter Installing @tramp{} into @value{emacs-name}.
460
@cindex installation
Kai Großjohann's avatar
Kai Großjohann committed
461

462 463 464 465
If you use the version that comes with your @value{emacs-name}, the
following information is not necessary.  Installing @tramp{} into your
@value{emacs-name} is a relatively easy process, at least compared
to rebuilding your machine from scratch. ;)
Kai Großjohann's avatar
Kai Großjohann committed
466 467 468 469

Seriously though, the installation should be a fairly simple matter.
The easiest way to proceed is as follows:

470
@itemize @bullet
Kai Großjohann's avatar
Kai Großjohann committed
471
@item
Kai Großjohann's avatar
Kai Großjohann committed
472 473
Choose a directory, say @file{~/@value{emacs-dir}/}.  Change into that
directory and unpack the tarball.  This will give you a directory
474 475 476
@file{~/@value{emacs-dir}/tramp-@trampver{}/} which contains
subdirectories @file{lisp} for the Lisp code and @file{texi} for the
documentation.  Make a symbolic link:
477

Kai Großjohann's avatar
Kai Großjohann committed
478
@example
479
ln -s tramp-@trampver{} tramp
Kai Großjohann's avatar
Kai Großjohann committed
480 481
@end example

482 483 484
@item
@command{cd} to @file{~/@value{emacs-dir}/tramp/} and type
@command{./configure} to configure Tramp for your system.
Kai Großjohann's avatar
Kai Großjohann committed
485

486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
Running `configure' takes awhile.  While running, it prints some
messages telling which features it is checking for.

@item
Type @command{make} to build the byte-compiled Lisp files as well as
the Info manual.

@item
Type @command{make install} to install the Tramp Lisp files and Info
manual.

@item
You can remove the byte-compiled Lisp files and the Info manual from
the source directory by typing @command{make clean}.  To also remove
the files that @command{configure} created, type @command{make
distclean}.
Kai Großjohann's avatar
Kai Großjohann committed
502

Kai Großjohann's avatar
Kai Großjohann committed
503
@item
504
NOTE: If you run into problems running the example @command{make}
505
command, don't despair.  You can still byte compile the @file{*.el}
506 507 508 509 510 511 512
files by opening @value{emacs-name} in @command{dired} (@command{C-x
d}) mode, at @file{~/@value{emacs-dir}/tramp/lisp}.  Mark the lisp files with
@kbd{m}, then press @kbd{B} to byte compile your selections.

Something similar can be done to create the info manual.  Just change
to directory @file{~/@value{emacs-dir}/tramp/texi} and load the
@file{tramp.texi} file in @value{emacs-name}.  Then press @kbd{M-x
513 514 515
texinfo-format-buffer @key{RET}} to generate
@file{~/@value{emacs-dir}/tramp/info/tramp}.
@end itemize
Kai Großjohann's avatar
Kai Großjohann committed
516

517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592
@menu
* Installation parameters::     Parameters in order to control installation.
* Load paths::                  How to plug-in @tramp{} into your environment.
@end menu

@node Installation parameters
@section Parameters in order to control installation.
@cindex installation

By default, @command{make install} will install @tramp{}'s files in
@file{@value{lispdir}} and @file{@value{infodir}}.  You can specify an
installation prefix other than @file{@value{prefix}} by giving
@command{configure} the option @command{--prefix=PATH}.

If your installed copy of Emacs is named something other than
@command{@value{emacs-dir}}, you will need to tell `make' where to find it so
that it can correctly byte-compile the @tramp{} sources.

For example, to force the use of @value{emacs-other-name} you might do
this:

@example
./configure --with-@value{emacs-other-dir}
make
make install
@end example

or this:

@example
./configure
make EMACS=/usr/bin/@value{emacs-other-dir}-21.4
make install
@end example

The syntax of @tramp{} file names is different for @value{emacs-name}
and @value{emacs-other-name}.  The Info manual will be generated for
the Emacs flavor choosen in the @command{configure} phase. If you want
the Info manual for the other version, you need to set the variable
@command{EMACS_INFO} to @command{make}:

@example
./configure --with-@value{emacs-dir}
make EMACS_INFO=@value{emacs-other-dir}
@end example

Also, the @command{--prefix=PATH} option to @command{configure} may
not be general enough to set the paths you want.  If not, you can pass
variables to the @command{make} command to control the installation.
For a complete list of tweakable variables, look in the makefile.

For example, to put the Lisp files in @file{~/elisp} and the Info file
in @file{~/info}, you would type:

@example
./configure
make
make lispdir=~/elisp infodir=~/info install
@end example

@tramp{} has some packages in its @file{contrib} directory which are
missing in older Emacsen.  If you want to use them, you must use the
@command{USE_CONTRIB} environment variable:

@example
make USE_CONTRIB=1
make USE_CONTRIB=1 install
@end example

@node Load paths
@section How to plug-in @tramp{} into your environment.
@cindex installation

If you don't install @tramp{} into the intended directories, but prefer
to use from the source directory, you need to add the following lines
into your @file{.emacs}:
593

Kai Großjohann's avatar
Kai Großjohann committed
594
@lisp
595
(add-to-list 'load-path "~/@value{emacs-dir}/tramp/lisp/")
Kai Großjohann's avatar
Kai Großjohann committed
596
(add-to-list 'load-path "~/@value{emacs-dir}/tramp/contrib/")
Kai Großjohann's avatar
Kai Großjohann committed
597 598 599
(require 'tramp)
@end lisp

600 601 602 603 604 605 606 607 608 609 610 611 612 613
The second load-path must be used only if you've applied the
@command{USE_CONTRIB} parameter.

@ifset xemacs
NOTE: For @value{emacs-name}, the package @file{fsf-compat} must be
installed.  For details on package installation, see @ref{Packages, ,
,xemacs}.
@ifhtml
(If the previous link doesn't work, try the @value{emacs-name}
documentation at
@uref{http://www.xemacs.org/Documentation/packageGuide.html,the
@value{emacs-name} site}.)
@end ifhtml
@end ifset
Kai Großjohann's avatar
Kai Großjohann committed
614

Kai Großjohann's avatar
Kai Großjohann committed
615
To be able to read the Info documentation, create a file
616
@file{~/@value{emacs-dir}/tramp/info/dir} using the
617
@command{install-info} command, and add the directory to the search
Kai Großjohann's avatar
Kai Großjohann committed
618 619 620
path for Info.

NOTE:
621 622
On systems using the @cite{gnu} version of @command{install-info}, the
@command{install-info} syntax is very direct and simple.  One can
623
change to directory @file{~/@value{emacs-dir}/tramp/info} and type:
624

Kai Großjohann's avatar
Kai Großjohann committed
625
@example
626
install-info tramp dir
627 628
@end example

Kai Großjohann's avatar
Kai Großjohann committed
629 630 631
and a @file{dir} file will be created with the @tramp{}
entry.  The info reader will know how to interpret it, but must
be told where to find it (see below).  If you want anything fancier
632
you'll need to look through @kbd{man install-info}.
Kai Großjohann's avatar
Kai Großjohann committed
633

634 635 636 637 638 639 640
Debian gnu/linux doesn't default to @cite{gnu} @command{install-info}
and uses its own version.  This version does not create a @file{dir}
file for you from scratch.  You must provide a skeleton @file{dir}
file it recognizes.  One can be found in a default installation of
@value{emacs-name} at @file{/usr/info/dir}.  Copy the top of this file
down to the first occurrence of @code{* Menu} including that line plus
one more blank line, to your working directory
641
@file{~/@value{emacs-dir}/tramp/info}, or use the sample
642 643 644 645 646
@file{~/@value{emacs-dir}/tramp/texi/dir_sample}.

Once a @file{dir} file is in place, this command will make the entry:

@example
647
install-info --infodir=. tramp
Kai Großjohann's avatar
Kai Großjohann committed
648 649
@end example

650 651 652
If you want it in a specific category see @kbd{man install-info} for
further details.

Kai Großjohann's avatar
Kai Großjohann committed
653
If the environment variable @env{INFOPATH} is set, add the directory
654
@file{~/@value{emacs-dir}/tramp/info/} to it.  Else, add the directory to
655
@ifset emacs
Kai Großjohann's avatar
Kai Großjohann committed
656
@code{Info-default-directory-list}, as follows:
657

Kai Großjohann's avatar
Kai Großjohann committed
658
@lisp
659
(add-to-list 'Info-default-directory-list "~/@value{emacs-dir}/tramp/info/")
Kai Großjohann's avatar
Kai Großjohann committed
660
@end lisp
661 662 663 664
@end ifset
@ifset xemacs
@code{Info-directory-list}, as follows:
@lisp
665
(add-to-list 'Info-directory-list "~/@value{emacs-dir}/tramp/info/")
666 667
@end lisp
@end ifset
Kai Großjohann's avatar
Kai Großjohann committed
668 669 670

@node Configuration
@chapter Configuring @tramp{} for use
671
@cindex configuration
Kai Großjohann's avatar
Kai Großjohann committed
672

673
@cindex default configuration
Kai Großjohann's avatar
Kai Großjohann committed
674
@tramp{} is (normally) fully functional when it is initially
675
installed.  It is initially configured to use the @command{ssh} program
676 677 678
to connect to the remote host and to use base-64 encoding (on the
remote host, via @command{mimencode}, and on the local host via the
built-in support for base-64 encoding in Emacs).
Kai Großjohann's avatar
Kai Großjohann committed
679 680 681 682 683

On some hosts, there are problems with opening a connection.  These are
related to the behavior of the remote shell.  See @xref{Remote shell
setup}, for details on this.

684 685 686 687 688
If you do not wish to use these commands to connect to the remote
host, you should change the default connection and transfer method
that @tramp uses.  There are several different methods that @tramp{}
can use to connect to remote machines and transfer files
(@pxref{Connection types}).
Kai Großjohann's avatar
Kai Großjohann committed
689 690 691 692 693 694 695 696 697


@menu
* 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.
* Default Method::              Selecting a default method.
* Customizing Methods::         Using Non-Standard Methods.
698
* Customizing Completion::      Selecting config files for user/host name completion.
Kai Großjohann's avatar
Kai Großjohann committed
699 700 701
* Remote Programs::             How @tramp{} finds and uses programs on the remote machine.
* Remote shell setup::          Remote shell setup hints.
* Windows setup hints::         Issues with Cygwin ssh.
702
* Auto-save and Backup::        Auto-save and Backup.
Kai Großjohann's avatar
Kai Großjohann committed
703 704 705 706 707
@end menu


@node Connection types
@section Types of connections made to remote machines.
708
@cindex connection types, overview
Kai Großjohann's avatar
Kai Großjohann committed
709 710

There are two basic types of transfer methods, each with its own
711
advantages and limitations.  Both types of connection make use of a
Kai Großjohann's avatar
Kai Großjohann committed
712 713 714 715 716 717 718 719
remote shell access program such as @command{rsh}, @command{ssh} or
@command{telnet} to connect to the remote machine.

This connection is used to perform many of the operations that @tramp
requires to make the remote file system transparently accessible from
the local machine. It is only when visiting files that the methods
differ.

720 721 722 723 724 725 726 727
@cindex inline methods
@cindex external transfer methods
@cindex external methods
@cindex out-of-band methods
@cindex methods, inline
@cindex methods, external transfer
@cindex methods, out-of-band
Loading or saving a remote file requires that the content of the file
728 729 730
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
731 732 733 734
a remote copy program such as @command{rcp}, @command{scp} or
@command{rsync}.  The former are called @dfn{inline methods}, the
latter are called @dfn{out-of-band methods} or @dfn{external transfer
methods} (@dfn{external methods} for short).
Kai Großjohann's avatar
Kai Großjohann committed
735 736

The performance of the external transfer methods is generally better
737 738 739
than that of the inline methods, at least for large files.  This is
caused by the need to encode and decode the data when transferring
inline.
Kai Großjohann's avatar
Kai Großjohann committed
740 741 742 743 744 745 746 747 748 749 750

The one exception to this rule are the @command{scp} based transfer
methods.  While these methods do see better performance when actually
transferring files, the overhead of the cryptographic negotiation at
startup may drown out the improvement in file transfer times.

External transfer methods do require that the remote copy command is not
interactive --- that is, the command does not prompt you for a password.
If you cannot perform remote copies without a password, you will need to
use an inline transfer method to work with @tramp{}.

751 752
@cindex multi-hop methods
@cindex methods, multi-hop
Kai Großjohann's avatar
Kai Großjohann committed
753 754 755 756 757 758 759 760 761
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.


@node Inline methods
@section Inline methods
762 763
@cindex inline methods
@cindex methods, inline
Kai Großjohann's avatar
Kai Großjohann committed
764 765 766 767 768 769 770 771 772

The inline methods in @tramp{} are quite powerful and can work in
situations where you cannot use an external transfer program to connect.
Inline methods are the only methods that work when connecting to the
remote machine via telnet.  (There are also strange inline methods which
allow you to transfer files between @emph{user identities} rather than
hosts, see below.)

These methods depend on the existence of a suitable encoding and
773
decoding command on remote machine.  Locally, @tramp{} may be able to use
Kai Großjohann's avatar
Kai Großjohann committed
774 775 776
features of Emacs to decode and encode the files or it may require
access to external commands to perform that task.

777 778 779
@cindex uuencode
@cindex mimencode
@cindex base-64 encoding
780 781 782 783 784
@tramp{} checks the availability and usability of commands like
@command{mimencode} (part of the @command{metamail} package) or
@command{uuencode} on the remote host.  The first reliable command
will be used.  The search path can be customized, see @ref{Remote
Programs}.
Kai Großjohann's avatar
Kai Großjohann committed
785

786
If both commands aren't available on the remote host, @tramp{}
787 788
transfers a small piece of Perl code to the remote host, and tries to
apply it for encoding and decoding.
Kai Großjohann's avatar
Kai Großjohann committed
789 790


791 792 793 794
@table @asis
@item @option{rsh}
@cindex method rsh
@cindex rsh method
Kai Großjohann's avatar
Kai Großjohann committed
795

796 797
Connect to the remote host with @command{rsh}.  Due to the unsecure
connection it is recommended for very local host topology only.
Kai Großjohann's avatar
Kai Großjohann committed
798 799


800 801 802
@item @option{ssh}
@cindex method ssh
@cindex ssh method
Kai Großjohann's avatar
Kai Großjohann committed
803

804 805 806
Connect to the remote host with @command{ssh}.  This is identical to
the previous option except that the @command{ssh} package is used,
making the connection more secure.
Kai Großjohann's avatar
Kai Großjohann committed
807

808 809
There are also two variants, @option{ssh1} and @option{ssh2}, that
call @samp{ssh -1} and @samp{ssh -2}, respectively.  This way, you can
Kai Großjohann's avatar
Kai Großjohann committed
810 811 812
explicitly select whether you want to use the SSH protocol version 1
or 2 to connect to the remote host.  (You can also specify in
@file{~/.ssh/config}, the SSH configuration file, which protocol
813
should be used, and use the regular @option{ssh} method.)
Kai Großjohann's avatar
Kai Großjohann committed
814

815 816 817
Two other variants, @option{ssh1_old} and @option{ssh2_old}, use the
@command{ssh1} and @command{ssh2} commands explicitly.  If you don't
know what these are, you do not need these options.
Kai Großjohann's avatar
Kai Großjohann committed
818

819
All the methods based on @command{ssh} have an additional kludgy
820 821 822 823 824
feature: you can specify a host name which looks like @file{host#42}
(the real host name, then a hash sign, then a port number).  This
means to connect to the given host but to also pass @code{-p 42} as
arguments to the @command{ssh} command.

Kai Großjohann's avatar
Kai Großjohann committed
825

826 827 828
@item @option{telnet}
@cindex method telnet
@cindex telnet method
Kai Großjohann's avatar
Kai Großjohann committed
829

830 831
Connect to the remote host with @command{telnet}.  This is as unsecure
as the @option{rsh} method.
Kai Großjohann's avatar
Kai Großjohann committed
832 833


834
@item @option{su}
835 836
@cindex method su
@cindex su method
Kai Großjohann's avatar
Kai Großjohann committed
837

838 839
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.
Kai Großjohann's avatar
Kai Großjohann committed
840 841


842 843 844
@item @option{sudo}
@cindex method sudo
@cindex sudo method
Kai Großjohann's avatar
Kai Großjohann committed
845

846
This is similar to the @option{su} method, but it uses @command{sudo}
Kai Großjohann's avatar
Kai Großjohann committed
847 848 849 850
rather than @command{su} to become a different user.

Note that @command{sudo} must be configured to allow you to start a
shell as the user.  It would be nice if it was sufficient if
851 852
@command{ls} and @command{mimencode} were allowed, but that is not
easy to implement, so I haven't got around to it, yet.
Kai Großjohann's avatar
Kai Großjohann committed
853 854


855 856 857 858
@item @option{sshx}
@cindex method sshx
@cindex sshx method
@cindex Cygwin (with sshx method)
Kai Großjohann's avatar
Kai Großjohann committed
859

860 861
As you expect, this is similar to @option{ssh}, only a little
different.  Whereas @option{ssh} opens a normal interactive shell on
862
the remote host, this option uses @samp{ssh -t -t @var{host} -l
863
@var{user} /bin/sh} to open a connection.  This is useful for users
864 865 866 867
where the normal login shell is set up to ask them a number of
questions when logging in.  This procedure avoids these questions, and
just gives @tramp{} a more-or-less `standard' login shell to work
with.
Kai Großjohann's avatar
Kai Großjohann committed
868

869 870 871
Note that this procedure does not eliminate questions asked by
@command{ssh} itself.  For example, @command{ssh} might ask ``Are you
sure you want to continue connecting?'' if the host key of the remote
872
host is not known.  @tramp{} does not know how to deal with such a
873 874 875
question (yet), therefore you will need to make sure that you can log
in without such questions.

Kai Großjohann's avatar
Kai Großjohann committed
876 877 878
This is also useful for Windows users where @command{ssh}, when
invoked from an Emacs buffer, tells them that it is not allocating a
pseudo tty.  When this happens, the login shell is wont to not print
879 880 881
any shell prompt, which confuses @tramp{} mightily.  For reasons
unknown, some Windows ports for @command{ssh} (maybe the Cygwin one)
require the doubled @samp{-t} option.
Kai Großjohann's avatar
Kai Großjohann committed
882

883
This supports the @samp{-p} kludge.
884

Kai Großjohann's avatar
Kai Großjohann committed
885

886 887 888 889
@item @option{krlogin}
@cindex method krlogin
@cindex km krlogin
@cindex Kerberos (with krlogin method)
Kai Großjohann's avatar
Kai Großjohann committed
890

891
This method is also similar to @option{ssh}.  It only uses the
Kai Großjohann's avatar
Kai Großjohann committed
892 893 894
@command{krlogin -x} command to log in to the remote host.


895 896 897
@item @option{plink}
@cindex method plink
@cindex plink method
Kai Großjohann's avatar
Kai Großjohann committed
898 899

This method is mostly interesting for Windows users using the PuTTY
900
implementation of SSH.  It uses @samp{plink -ssh} to log in to the
Kai Großjohann's avatar
Kai Großjohann committed
901 902 903 904 905
remote host.

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?

906 907
CCC: Does @command{plink} support the @samp{-p} option?  @tramp{} will
support that, anyway.
908

909
@end table
Kai Großjohann's avatar
Kai Großjohann committed
910 911 912 913 914



@node External transfer methods
@section External transfer methods
915 916 917 918
@cindex methods, external transfer
@cindex methods, out-of-band
@cindex external transfer methods
@cindex out-of-band methods
Kai Großjohann's avatar
Kai Großjohann committed
919 920 921 922 923 924 925 926 927 928 929 930

The external transfer methods operate through multiple channels, using
the remote shell connection for many actions while delegating file
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 @emph{must} be able
to execute the transfer utility to copy files to and from the remote
machine without any interaction.

931
@cindex ssh-agent
Kai Großjohann's avatar
Kai Großjohann committed
932 933 934 935 936 937 938 939 940 941 942 943
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 @command{scp} to run without asking for a password but
would still like to use @command{ssh} to secure your connection, have a
look at the @command{ssh} based inline methods.


944
@table @asis
Kai Großjohann's avatar
Kai Großjohann committed
945
@item @option{rcp}  ---  @command{rsh} and @command{rcp}
946 947
@cindex method rcp
@cindex rcp method
Kai Großjohann's avatar
Kai Großjohann committed
948 949
@cindex rcp (with rcp method)
@cindex rsh (with rcp method)
Kai Großjohann's avatar
Kai Großjohann committed
950 951 952 953 954 955 956

This method uses the @command{rsh} and @command{rcp} commands to connect
to the remote machine and transfer files. This is probably the fastest
connection method available.


@item @option{scp}  ---  @command{ssh} and @command{scp}
957 958
@cindex method scp
@cindex scp method
Kai Großjohann's avatar
Kai Großjohann committed
959 960
@cindex scp (with scp method)
@cindex ssh (with scp method)
Kai Großjohann's avatar
Kai Großjohann committed
961 962 963 964 965 966 967 968 969 970 971

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 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
decoding presents.

972 973 974 975 976 977 978 979 980 981 982
There are also two variants, @option{scp1} and @option{scp2}, that
call @samp{ssh -1} and @samp{ssh -2}, respectively.  This way, you can
explicitly select whether you want to use the SSH protocol version 1
or 2 to connect to the remote host.  (You can also specify in
@file{~/.ssh/config}, the SSH configuration file, which protocol
should be used, and use the regular @option{ssh} method.)

Two other variants, @option{scp1_old} and @option{scp2_old}, use the
@command{ssh1} and @command{ssh2} commands explicitly.  If you don't
know what these are, you do not need these options.

983
All the @command{ssh} based methods support the kludgy @samp{-p}
984
feature where you can specify a port number to connect to in the host
985
name.  For example, the host name @file{host#42} tells @tramp{} to
986
specify @samp{-p 42} in the argument list for @command{ssh}.
987

Kai Großjohann's avatar
Kai Großjohann committed
988 989

@item @option{rsync}  ---  @command{ssh} and @command{rsync}
990 991
@cindex method rsync
@cindex rsync method
Kai Großjohann's avatar
Kai Großjohann committed
992 993
@cindex rsync (with rsync method)
@cindex ssh (with rsync method)
Kai Großjohann's avatar
Kai Großjohann committed
994 995 996 997 998 999 1000 1001 1002 1003 1004

Using the @command{ssh} command to connect securely to the remote
machine and the @command{rsync} command to transfer files is almost
identical to the @option{scp} method.

While @command{rsync} performs much better than @command{scp} when
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
1005
files to the local machine is no faster than with a direct copy.
Kai Großjohann's avatar
Kai Großjohann committed
1006

1007
This method supports the @samp{-p} hack.
1008

Kai Großjohann's avatar
Kai Großjohann committed
1009 1010

@item @option{scpx} --- @command{ssh} and @command{scp}
1011 1012
@cindex method scpx
@cindex scpx method
Kai Großjohann's avatar
Kai Großjohann committed
1013 1014 1015
@cindex scp (with scpx method)
@cindex ssh (with scpx method)
@cindex Cygwin (with scpx method)
Kai Großjohann's avatar
Kai Großjohann committed
1016 1017

As you expect, this is similar to @option{scp}, only a little
1018 1019 1020 1021 1022 1023 1024
different.  Whereas @option{scp} opens a normal interactive shell on
the remote host, this option uses @samp{ssh -t -t @var{host} -l
@var{user} /bin/sh} to open a connection.  This is useful for users
where the normal login shell is set up to ask them a number of
questions when logging in.  This procedure avoids these questions, and
just gives @tramp{} a more-or-less `standard' login shell to work
with.
Kai Großjohann's avatar
Kai Großjohann committed
1025 1026 1027 1028

This is also useful for Windows users where @command{ssh}, when
invoked from an Emacs buffer, tells them that it is not allocating a
pseudo tty.  When this happens, the login shell is wont to not print
1029 1030
any shell prompt, which confuses @tramp{} mightily.  Maybe this
applies to the Cygwin port of SSH.
Kai Großjohann's avatar
Kai Großjohann committed
1031

1032
This method supports the @samp{-p} hack.
1033

Kai Großjohann's avatar
Kai Großjohann committed
1034 1035

@item @option{pscp} --- @command{plink} and @command{pscp}
1036 1037
@cindex method pscp
@cindex pscp method
Kai Großjohann's avatar
Kai Großjohann committed
1038 1039 1040
@cindex pscp (with pscp method)
@cindex plink (with pscp method)
@cindex PuTTY (with pscp method)
Kai Großjohann's avatar
Kai Großjohann committed
1041 1042 1043 1044 1045 1046

This method is similar to @option{scp}, but it uses the
@command{plink} command to connect to the remote host, and it uses
@command{pscp} for transferring the files.  These programs are part
of PuTTY, an SSH implementation for Windows.

1047
CCC: Does @command{plink} support the @samp{-p} hack?
1048

Kai Großjohann's avatar
Kai Großjohann committed
1049 1050

@item @option{fcp} --- @command{fsh} and @command{fcp}
1051 1052
@cindex method fcp
@cindex fcp method
Kai Großjohann's avatar
Kai Großjohann committed
1053 1054
@cindex fsh (with fcp method)
@cindex fcp (with fcp method)
Kai Großjohann's avatar
Kai Großjohann committed
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064

This method is similar to @option{scp}, but it uses the @command{fsh}
command to connect to the remote host, and it uses @command{fcp} for
transferring the files.  @command{fsh/fcp} are a front-end for
@command{ssh} which allow for reusing the same @command{ssh} session
for submitting several commands.  This avoids the startup overhead of
@command{scp} (which has to establish a secure connection whenever it
is called).  Note, however, that you can also use one of the inline
methods to achieve a similar effect.

1065 1066 1067
This method uses the command @samp{fsh @var{host} -l @var{user}
/bin/sh -i} to establish the connection, it does not work to just say
@command{fsh @var{host} -l @var{user}}.
Kai Großjohann's avatar
Kai Großjohann committed
1068

Kai Großjohann's avatar
Kai Großjohann committed
1069 1070
@cindex method fsh
@cindex fsh method
1071 1072 1073 1074 1075
There is no inline method using @command{fsh} as the multiplexing
provided by the program is not very useful in our context.  @tramp{}
opens just one connection to the remote host and then keeps it open,
anyway.

1076 1077 1078 1079 1080 1081

@ifset emacs
@item @option{ftp}
@cindex method ftp
@cindex ftp method

1082
This is not a native @tramp{} method. Instead of, it forwards all
1083 1084 1085
requests to @value{ftp-package-name}.
@end ifset

1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097

@item @option{smb} --- @command{smbclient}
@cindex method smb
@cindex smb method

This is another not natural @tramp{} method.  It uses the
@command{smbclient} command on different Unices in order to connect to
an SMB server.  An SMB server might be a Samba (or CIFS) server on
another UNIX host or, more interesting, a host running MS Windows.  So
far, it is tested towards MS Windows NT, MS Windows 2000, and MS
Windows XP.

Kai Großjohann's avatar
Kai Großjohann committed
1098
The first directory in the localname must be a share name on the remote
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
host.  Remember, that the @code{$} character in which default shares
usually end, must be written @code{$$} due to environment variable
substitution in file names.  If no share name is given (i.e. remote
directory @code{/}), all available shares are listed.

Since authorization is done on share level, you will be prompted
always for a password if you access another share on the same host.
Due to security reasons, the password is not cached.

MS Windows uses for authorization both a user name and a domain name.
Because of this, the @tramp{} syntax has been extended: you can
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{tramp-prefix}smb@value{tramp-postfix-single-hop}daniel%BIZARRE@@melancholia@value{tramp-postfix}/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
prompting) is assumed.  This is different from all other @tramp{}
methods, where in such a case the local user name is taken.

The @option{smb} method supports the @samp{-p} hack.

@strong{Please note:} If Emacs runs locally under MS Windows, this
method isn't available.  Instead of, you can use UNC file names like
@file{//melancholia/daniel$$/.emacs}.  The only disadvantage is that
there's no possiblity to specify another user name.

1129
@end table
Kai Großjohann's avatar
Kai Großjohann committed
1130 1131 1132

@node Multi-hop Methods
@section Connecting to a remote host using multiple hops
1133 1134
@cindex multi-hop methods
@cindex methods, multi-hop
Kai Großjohann's avatar
Kai Großjohann committed
1135 1136 1137 1138 1139 1140 1141 1142 1143

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
@tramp{} methods.

1144 1145
@cindex method multi
@cindex multi method
Kai Großjohann's avatar
Kai Großjohann committed
1146 1147
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
1148
@option{multi}.
Kai Großjohann's avatar
Kai Großjohann committed
1149

1150 1151 1152
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:
Kai Großjohann's avatar
Kai Großjohann committed
1153

1154 1155 1156 1157
@table @option
@item telnet
@cindex hop method telnet
@cindex telnet hop method
Kai Großjohann's avatar
Kai Großjohann committed
1158 1159 1160 1161 1162

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.

1163 1164 1165
@item rsh
@cindex hop method rsh
@cindex rsh hop method
Kai Großjohann's avatar
Kai Großjohann committed
1166 1167 1168 1169

This uses @command{rsh} to connect to the host.  You do not need to
enter a password unless @command{rsh} explicitly asks for it.

1170 1171 1172
@item ssh
@cindex hop method ssh
@cindex ssh hop method
Kai Großjohann's avatar
Kai Großjohann committed
1173 1174 1175 1176

This uses @command{ssh} to connect to the host.  You might have to enter
a password or a pass phrase.

1177 1178 1179
@item su
@cindex hop method su
@cindex su hop method
Kai Großjohann's avatar
Kai Großjohann committed
1180 1181 1182 1183 1184