diff options
| author | Michael Albinus | 2007-07-08 18:05:03 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-07-08 18:05:03 +0000 |
| commit | 8238a14007439c941174badeb59e4a5fc1b1e5df (patch) | |
| tree | 4349220b0c713fc49f6d4ddcc5dbca78fa0dc440 | |
| parent | 00d6fd04d83f59b13c77aa999384367cde81b413 (diff) | |
| download | emacs-8238a14007439c941174badeb59e4a5fc1b1e5df.tar.gz emacs-8238a14007439c941174badeb59e4a5fc1b1e5df.zip | |
* tramp.texi:
* trampver.texi: Migrate to Tramp 2.1.
| -rw-r--r-- | man/ChangeLog | 5 | ||||
| -rw-r--r-- | man/tramp.texi | 1460 | ||||
| -rw-r--r-- | man/trampver.texi | 27 |
3 files changed, 1127 insertions, 365 deletions
diff --git a/man/ChangeLog b/man/ChangeLog index ad2d3b889f2..e185cd51f7b 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-07-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * tramp.texi: | ||
| 4 | * trampver.texi: Migrate to Tramp 2.1. | ||
| 5 | |||
| 1 | 2007-07-02 Carsten Dominik <dominik@science.uva.nl> | 6 | 2007-07-02 Carsten Dominik <dominik@science.uva.nl> |
| 2 | 7 | ||
| 3 | * org.texi (Properties): New chapter. | 8 | * org.texi (Properties): New chapter. |
diff --git a/man/tramp.texi b/man/tramp.texi index 67b0647787c..fbcce166636 100644 --- a/man/tramp.texi +++ b/man/tramp.texi | |||
| @@ -18,15 +18,27 @@ | |||
| 18 | @include trampver.texi | 18 | @include trampver.texi |
| 19 | 19 | ||
| 20 | @c Macros for formatting a filename. | 20 | @c Macros for formatting a filename. |
| 21 | @c trampfn is for a full filename, trampfnmhp means method, host, localname | 21 | @c trampfn is for a full filename, trampfnmhl means method, host, localname |
| 22 | @c were given, and so on. | 22 | @c were given, and so on. |
| 23 | @macro trampfn(method, user, host, localname) | 23 | @macro trampfn {method, user, host, localname} |
| 24 | @value{prefix}@value{method}@value{user}@@@value{host}@value{postfix}@value{localname} | 24 | @value{prefix}\method\@value{postfixhop}\user\@@\host\@value{postfix}\localname\ |
| 25 | @end macro | ||
| 26 | |||
| 27 | @macro trampfnmhl {method, host, localname} | ||
| 28 | @value{prefix}\method\@value{postfixhop}\host\@value{postfix}\localname\ | ||
| 29 | @end macro | ||
| 30 | |||
| 31 | @macro trampfnuhl {user, host, localname} | ||
| 32 | @value{prefix}\user\@@\host\@value{postfix}\localname\ | ||
| 33 | @end macro | ||
| 34 | |||
| 35 | @macro trampfnhl {host, localname} | ||
| 36 | @value{prefix}\host\@value{postfix}\localname\ | ||
| 25 | @end macro | 37 | @end macro |
| 26 | 38 | ||
| 27 | @copying | 39 | @copying |
| 28 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 | 40 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| 29 | Free Software Foundation, Inc. | 41 | 2007 Free Software Foundation, Inc. |
| 30 | 42 | ||
| 31 | @quotation | 43 | @quotation |
| 32 | Permission is granted to copy, distribute and/or modify this document | 44 | Permission is granted to copy, distribute and/or modify this document |
| @@ -157,6 +169,7 @@ For the developer: | |||
| 157 | 169 | ||
| 158 | * Version Control:: The inner workings of remote version control. | 170 | * Version Control:: The inner workings of remote version control. |
| 159 | * Files directories and localnames:: How file names, directories and localnames are mangled and managed. | 171 | * Files directories and localnames:: How file names, directories and localnames are mangled and managed. |
| 172 | * Traces and Profiles:: How to Customize Traces. | ||
| 160 | * Issues:: Debatable Issues and What Was Decided. | 173 | * Issues:: Debatable Issues and What Was Decided. |
| 161 | 174 | ||
| 162 | * GNU Free Documentation License:: The license for this documentation. | 175 | * GNU Free Documentation License:: The license for this documentation. |
| @@ -178,11 +191,17 @@ Configuring @value{tramp} for use | |||
| 178 | * Connection types:: Types of connections made to remote machines. | 191 | * Connection types:: Types of connections made to remote machines. |
| 179 | * Inline methods:: Inline methods. | 192 | * Inline methods:: Inline methods. |
| 180 | * External transfer methods:: External transfer methods. | 193 | * External transfer methods:: External transfer methods. |
| 181 | * Multi-hop Methods:: Connecting to a remote host using multiple hops. | 194 | @ifset emacsgw |
| 195 | * Gateway methods:: Gateway methods. | ||
| 196 | @end ifset | ||
| 182 | * Default Method:: Selecting a default method. | 197 | * Default Method:: Selecting a default method. |
| 198 | * Default User:: Selecting a default user. | ||
| 199 | * Default Host:: Selecting a default host. | ||
| 200 | * Multi-hops:: Connecting to a remote host using multiple hops. | ||
| 183 | * Customizing Methods:: Using Non-Standard Methods. | 201 | * Customizing Methods:: Using Non-Standard Methods. |
| 184 | * Customizing Completion:: Selecting config files for user/host name completion. | 202 | * Customizing Completion:: Selecting config files for user/host name completion. |
| 185 | * Password caching:: Reusing passwords for several connections. | 203 | * Password caching:: Reusing passwords for several connections. |
| 204 | * Connection caching:: Reusing connection related information. | ||
| 186 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. | 205 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. |
| 187 | * Remote shell setup:: Remote shell setup hints. | 206 | * Remote shell setup:: Remote shell setup hints. |
| 188 | * Windows setup hints:: Issues with Cygwin ssh. | 207 | * Windows setup hints:: Issues with Cygwin ssh. |
| @@ -191,10 +210,9 @@ Configuring @value{tramp} for use | |||
| 191 | Using @value{tramp} | 210 | Using @value{tramp} |
| 192 | 211 | ||
| 193 | * Filename Syntax:: @value{tramp} filename conventions. | 212 | * Filename Syntax:: @value{tramp} filename conventions. |
| 194 | * Multi-hop filename syntax:: Multi-hop filename conventions. | 213 | * Alternative Syntax:: URL-like filename syntax. |
| 195 | * Filename completion:: Filename completion. | 214 | * Filename completion:: Filename completion. |
| 196 | * Dired:: Dired. | 215 | * Remote processes:: Integration with other @value{emacsname} packages (@sc{experimental}). |
| 197 | * Compilation:: Compile remote files. | ||
| 198 | 216 | ||
| 199 | The inner workings of remote version control | 217 | The inner workings of remote version control |
| 200 | 218 | ||
| @@ -220,10 +238,10 @@ How file names, directories and localnames are mangled and managed | |||
| 220 | @chapter An overview of @value{tramp} | 238 | @chapter An overview of @value{tramp} |
| 221 | @cindex overview | 239 | @cindex overview |
| 222 | 240 | ||
| 223 | After the installation of @value{tramp} into your @value{emacsname}, | 241 | After the installation of @value{tramp} into your @value{emacsname}, you |
| 224 | you will be able to access files on remote machines as though they | 242 | will be able to access files on remote machines as though they were |
| 225 | were local. Access to the remote file system for editing files, | 243 | local. Access to the remote file system for editing files, version |
| 226 | version control, and @code{dired} are transparently enabled. | 244 | control, and @code{dired} are transparently enabled. |
| 227 | 245 | ||
| 228 | Your access to the remote machine can be with the @command{rsh}, | 246 | Your access to the remote machine can be with the @command{rsh}, |
| 229 | @command{rlogin}, @command{telnet} programs or with any similar | 247 | @command{rlogin}, @command{telnet} programs or with any similar |
| @@ -380,7 +398,7 @@ behind the scenes when you open a file with @value{tramp}. | |||
| 380 | 398 | ||
| 381 | @value{tramp} is freely available on the Internet and the latest | 399 | @value{tramp} is freely available on the Internet and the latest |
| 382 | release may be downloaded from | 400 | release may be downloaded from |
| 383 | @uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full | 401 | @uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full |
| 384 | documentation and code for @value{tramp}, suitable for installation. | 402 | documentation and code for @value{tramp}, suitable for installation. |
| 385 | But GNU Emacs (22 or later) includes @value{tramp} already, and there | 403 | But GNU Emacs (22 or later) includes @value{tramp} already, and there |
| 386 | is a @value{tramp} package for XEmacs, as well. So maybe it is easier | 404 | is a @value{tramp} package for XEmacs, as well. So maybe it is easier |
| @@ -389,7 +407,7 @@ on@dots{...} | |||
| 389 | 407 | ||
| 390 | For the especially brave, @value{tramp} is available from CVS. The CVS | 408 | For the especially brave, @value{tramp} is available from CVS. The CVS |
| 391 | version is the latest version of the code and may contain incomplete | 409 | version is the latest version of the code and may contain incomplete |
| 392 | features or new issues. Use these versions at your own risk. | 410 | features or new issues. Use these versions at your own risk. |
| 393 | 411 | ||
| 394 | Instructions for obtaining the latest development version of @value{tramp} | 412 | Instructions for obtaining the latest development version of @value{tramp} |
| 395 | from CVS can be found by going to the Savannah project page at the | 413 | from CVS can be found by going to the Savannah project page at the |
| @@ -410,7 +428,7 @@ Or follow the example session below: | |||
| 410 | 428 | ||
| 411 | @noindent | 429 | @noindent |
| 412 | You should now have a directory @file{~/@value{emacsdir}/tramp} | 430 | You should now have a directory @file{~/@value{emacsdir}/tramp} |
| 413 | containing the latest version of @value{tramp}. You can fetch the latest | 431 | containing the latest version of @value{tramp}. You can fetch the latest |
| 414 | updates from the repository by issuing the command: | 432 | updates from the repository by issuing the command: |
| 415 | 433 | ||
| 416 | @example | 434 | @example |
| @@ -429,6 +447,11 @@ script: | |||
| 429 | ] @strong{autoconf} | 447 | ] @strong{autoconf} |
| 430 | @end example | 448 | @end example |
| 431 | 449 | ||
| 450 | People who have no direct CVS access (maybe because sitting behind a | ||
| 451 | blocking firewall), can try the | ||
| 452 | @uref{http://savannah.gnu.org/cvs-backup/tramp-sources.tar.gz, Nightly | ||
| 453 | CVS Tree Tarball} instead of. | ||
| 454 | |||
| 432 | 455 | ||
| 433 | @node History | 456 | @node History |
| 434 | @chapter History of @value{tramp} | 457 | @chapter History of @value{tramp} |
| @@ -445,7 +468,19 @@ file contents were added. Support for VC was added. | |||
| 445 | 468 | ||
| 446 | The most recent addition of major features were the multi-hop methods | 469 | The most recent addition of major features were the multi-hop methods |
| 447 | added in April 2000 and the unification of @value{tramp} and Ange-FTP | 470 | added in April 2000 and the unification of @value{tramp} and Ange-FTP |
| 448 | filenames in July 2002. | 471 | filenames in July 2002. In July 2004, multi-hop methods have been |
| 472 | replaced by proxy hosts. Running commands on remote hosts was | ||
| 473 | introduced in December 2005. | ||
| 474 | @ifset emacsgw | ||
| 475 | Support of gateways exists since April 2007. | ||
| 476 | @end ifset | ||
| 477 | |||
| 478 | In December 2001, @value{tramp} has been added to the XEmacs package | ||
| 479 | repository. Being part of the GNU Emacs repository happened in June | ||
| 480 | 2002, the first release including @value{tramp} was GNU Emacs 22.1. | ||
| 481 | |||
| 482 | @value{tramp} is also a GNU/Linux Debian package since February 2001. | ||
| 483 | |||
| 449 | 484 | ||
| 450 | @c Installation chapter is necessary only in case of standalone | 485 | @c Installation chapter is necessary only in case of standalone |
| 451 | @c installation. Text taken from trampinst.texi. | 486 | @c installation. Text taken from trampinst.texi. |
| @@ -462,7 +497,7 @@ filenames in July 2002. | |||
| 462 | installed. It is initially configured to use the @command{scp} | 497 | installed. It is initially configured to use the @command{scp} |
| 463 | program to connect to the remote host. So in the easiest case, you | 498 | program to connect to the remote host. So in the easiest case, you |
| 464 | just type @kbd{C-x C-f} and then enter the filename | 499 | just type @kbd{C-x C-f} and then enter the filename |
| 465 | @file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}. | 500 | @file{@trampfnuhl{user, machine, /path/to.file}}. |
| 466 | 501 | ||
| 467 | On some hosts, there are problems with opening a connection. These are | 502 | On some hosts, there are problems with opening a connection. These are |
| 468 | related to the behavior of the remote shell. See @xref{Remote shell | 503 | related to the behavior of the remote shell. See @xref{Remote shell |
| @@ -482,14 +517,20 @@ Method}. | |||
| 482 | * Connection types:: Types of connections made to remote machines. | 517 | * Connection types:: Types of connections made to remote machines. |
| 483 | * Inline methods:: Inline methods. | 518 | * Inline methods:: Inline methods. |
| 484 | * External transfer methods:: External transfer methods. | 519 | * External transfer methods:: External transfer methods. |
| 485 | * Multi-hop Methods:: Connecting to a remote host using multiple hops. | 520 | @ifset emacsgw |
| 521 | * Gateway methods:: Gateway methods. | ||
| 522 | @end ifset | ||
| 486 | * Default Method:: Selecting a default method. | 523 | * Default Method:: Selecting a default method. |
| 487 | Here we also try to help those who | 524 | Here we also try to help those who |
| 488 | don't have the foggiest which method | 525 | don't have the foggiest which method |
| 489 | is right for them. | 526 | is right for them. |
| 527 | * Default User:: Selecting a default user. | ||
| 528 | * Default Host:: Selecting a default host. | ||
| 529 | * Multi-hops:: Connecting to a remote host using multiple hops. | ||
| 490 | * Customizing Methods:: Using Non-Standard Methods. | 530 | * Customizing Methods:: Using Non-Standard Methods. |
| 491 | * Customizing Completion:: Selecting config files for user/host name completion. | 531 | * Customizing Completion:: Selecting config files for user/host name completion. |
| 492 | * Password caching:: Reusing passwords for several connections. | 532 | * Password caching:: Reusing passwords for several connections. |
| 533 | * Connection caching:: Reusing connection related information. | ||
| 493 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. | 534 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. |
| 494 | * Remote shell setup:: Remote shell setup hints. | 535 | * Remote shell setup:: Remote shell setup hints. |
| 495 | * Windows setup hints:: Issues with Cygwin ssh. | 536 | * Windows setup hints:: Issues with Cygwin ssh. |
| @@ -508,7 +549,7 @@ remote shell access program such as @command{rsh}, @command{ssh} or | |||
| 508 | 549 | ||
| 509 | This connection is used to perform many of the operations that @value{tramp} | 550 | This connection is used to perform many of the operations that @value{tramp} |
| 510 | requires to make the remote file system transparently accessible from | 551 | requires to make the remote file system transparently accessible from |
| 511 | the local machine. It is only when visiting files that the methods | 552 | the local machine. It is only when visiting files that the methods |
| 512 | differ. | 553 | differ. |
| 513 | 554 | ||
| 514 | @cindex inline methods | 555 | @cindex inline methods |
| @@ -519,7 +560,7 @@ differ. | |||
| 519 | @cindex methods, external transfer | 560 | @cindex methods, external transfer |
| 520 | @cindex methods, out-of-band | 561 | @cindex methods, out-of-band |
| 521 | Loading or saving a remote file requires that the content of the file | 562 | Loading or saving a remote file requires that the content of the file |
| 522 | be transfered between the two machines. The content of the file can be | 563 | be transfered between the two machines. The content of the file can be |
| 523 | transfered over the same connection used to log in to the remote | 564 | transfered over the same connection used to log in to the remote |
| 524 | machine or the file can be transfered through another connection using | 565 | machine or the file can be transfered through another connection using |
| 525 | a remote copy program such as @command{rcp}, @command{scp} or | 566 | 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. | |||
| 539 | 580 | ||
| 540 | External transfer methods should be configured such a way that they | 581 | External transfer methods should be configured such a way that they |
| 541 | don't require a password (with @command{ssh-agent}, or such alike). | 582 | don't require a password (with @command{ssh-agent}, or such alike). |
| 542 | If it isn't possible, you should consider @ref{Password caching}, | 583 | Modern @command{scp} implementations offer options to reuse existing |
| 543 | otherwise you will be prompted for a password every copy action. | 584 | @command{ssh} connections, see method @command{scpc}. If it isn't |
| 544 | 585 | possible, you should consider @ref{Password caching}, otherwise you | |
| 545 | @cindex multi-hop methods | 586 | will be prompted for a password every copy action. |
| 546 | @cindex methods, multi-hop | ||
| 547 | A variant of the inline methods are the @dfn{multi-hop methods}. | ||
| 548 | These methods allow you to connect a remote host using a number `hops', | ||
| 549 | each of which connects to a different host. This is useful if you are | ||
| 550 | in a secured network where you need to go through a bastion host to | ||
| 551 | connect to the outside world. | ||
| 552 | 587 | ||
| 553 | 588 | ||
| 554 | @node Inline methods | 589 | @node Inline methods |
| @@ -635,6 +670,8 @@ as the @option{rsh} method. | |||
| 635 | 670 | ||
| 636 | This method does not connect to a remote host at all, rather it uses | 671 | This method does not connect to a remote host at all, rather it uses |
| 637 | the @command{su} program to allow you to edit files as another user. | 672 | the @command{su} program to allow you to edit files as another user. |
| 673 | With other words, a specified host name in the file name is silently | ||
| 674 | ignored. | ||
| 638 | 675 | ||
| 639 | 676 | ||
| 640 | @item @option{sudo} | 677 | @item @option{sudo} |
| @@ -682,7 +719,7 @@ This supports the @samp{-p} kludge. | |||
| 682 | 719 | ||
| 683 | @item @option{krlogin} | 720 | @item @option{krlogin} |
| 684 | @cindex method krlogin | 721 | @cindex method krlogin |
| 685 | @cindex km krlogin | 722 | @cindex krlogin method |
| 686 | @cindex Kerberos (with krlogin method) | 723 | @cindex Kerberos (with krlogin method) |
| 687 | 724 | ||
| 688 | This method is also similar to @option{ssh}. It only uses the | 725 | 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 | |||
| 697 | implementation of SSH. It uses @samp{plink -ssh} to log in to the | 734 | implementation of SSH. It uses @samp{plink -ssh} to log in to the |
| 698 | remote host. | 735 | remote host. |
| 699 | 736 | ||
| 700 | Additionally, the method @option{plink1} is provided, which calls | 737 | This supports the @samp{-P} kludge. |
| 701 | @samp{plink -1 -ssh} in order to use SSH protocol version 1 | 738 | |
| 702 | explicitly. | 739 | Additionally, the methods @option{plink1} and @option{plink2} are |
| 740 | provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in | ||
| 741 | order to use SSH protocol version 1 or 2 explicitly. | ||
| 703 | 742 | ||
| 704 | CCC: Do we have to connect to the remote host once from the command | 743 | CCC: Do we have to connect to the remote host once from the command |
| 705 | line to accept the SSH key? Maybe this can be made automatic? | 744 | line to accept the SSH key? Maybe this can be made automatic? |
| 706 | 745 | ||
| 707 | CCC: Does @command{plink} support the @samp{-p} option? @value{tramp} will | 746 | CCC: Say something about the first shell command failing. This might |
| 708 | support that, anyway. | 747 | be due to a wrong setting of @code{tramp-rsh-end-of-line}. |
| 709 | 748 | ||
| 710 | @end table | ||
| 711 | 749 | ||
| 750 | @item @option{plinkx} | ||
| 751 | @cindex method plinkx | ||
| 752 | @cindex plinkx method | ||
| 753 | |||
| 754 | Another method using PuTTY on Windows. Instead of host names, it | ||
| 755 | expects PuTTY session names, calling @samp{plink -load @var{session} | ||
| 756 | -t"}. User names are relevant only in case the corresponding session | ||
| 757 | hasn't defined a user name. Different port numbers must be defined in | ||
| 758 | the session. | ||
| 759 | |||
| 760 | |||
| 761 | @item @option{fish} | ||
| 762 | @cindex method fish | ||
| 763 | @cindex fish method | ||
| 764 | |||
| 765 | This is an experimental implementation of the fish protocol, known from | ||
| 766 | the GNU Midnight Commander or the KDE Konqueror. @value{tramp} expects | ||
| 767 | the fish server implementation from the KDE kioslave. That means, the | ||
| 768 | file @file{~/.fishsrv.pl} is expected to reside on the remote host. | ||
| 769 | |||
| 770 | The implementation lacks good performance. The code is offered anyway, | ||
| 771 | maybe somebody can improve the performance. | ||
| 772 | |||
| 773 | @end table | ||
| 712 | 774 | ||
| 713 | 775 | ||
| 714 | @node External transfer methods | 776 | @node External transfer methods |
| @@ -725,21 +787,10 @@ transfers to an external transfer utility. | |||
| 725 | This saves the overhead of encoding and decoding that multiplexing the | 787 | This saves the overhead of encoding and decoding that multiplexing the |
| 726 | transfer through the one connection has with the inline methods. | 788 | transfer through the one connection has with the inline methods. |
| 727 | 789 | ||
| 728 | If you want to use an external transfer method you should be able to | 790 | Since external transfer methods need their own overhead opening a new |
| 729 | execute the transfer utility to copy files to and from the remote | 791 | channel, all files which are smaller than @var{tramp-copy-size-limit} |
| 730 | machine without any interaction. | 792 | are still transferred with the corresponding inline method. It should |
| 731 | 793 | provide a fair trade-off between both approaches. | |
| 732 | @cindex ssh-agent | ||
| 733 | This means that you will need to use @command{ssh-agent} if you use the | ||
| 734 | @command{scp} program for transfers, or maybe your version of | ||
| 735 | @command{scp} accepts a password on the command line.@footnote{PuTTY's | ||
| 736 | @command{pscp} allows you to specify the password on the command line.} | ||
| 737 | If you use @command{rsync} via @command{ssh} then the same rule must | ||
| 738 | apply to that connection. | ||
| 739 | |||
| 740 | If you cannot get an external method to run without asking for a | ||
| 741 | password you should consider @ref{Password caching}. | ||
| 742 | |||
| 743 | 794 | ||
| 744 | @table @asis | 795 | @table @asis |
| 745 | @item @option{rcp} --- @command{rsh} and @command{rcp} | 796 | @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 | |||
| 767 | transfer files between the machines is the best method for securely | 818 | transfer files between the machines is the best method for securely |
| 768 | connecting to a remote machine and accessing files. | 819 | connecting to a remote machine and accessing files. |
| 769 | 820 | ||
| 770 | The performance of this option is also quite good. It may be slower than | 821 | The performance of this option is also quite good. It may be slower than |
| 771 | the inline methods when you often open and close small files however. | 822 | the inline methods when you often open and close small files however. |
| 772 | The cost of the cryptographic handshake at the start of an @command{scp} | 823 | The cost of the cryptographic handshake at the start of an @command{scp} |
| 773 | session can begin to absorb the advantage that the lack of encoding and | 824 | 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. | |||
| 787 | All the @command{ssh} based methods support the kludgy @samp{-p} | 838 | All the @command{ssh} based methods support the kludgy @samp{-p} |
| 788 | feature where you can specify a port number to connect to in the host | 839 | feature where you can specify a port number to connect to in the host |
| 789 | name. For example, the host name @file{host#42} tells @value{tramp} to | 840 | name. For example, the host name @file{host#42} tells @value{tramp} to |
| 790 | specify @samp{-p 42} in the argument list for @command{ssh}. | 841 | specify @samp{-p 42} in the argument list for @command{ssh}, and to |
| 842 | specify @samp{-P 42} in the argument list for @command{scp}. | ||
| 843 | |||
| 844 | |||
| 845 | @item @option{sftp} --- @command{ssh} and @command{sftp} | ||
| 846 | @cindex method sftp | ||
| 847 | @cindex sftp method | ||
| 848 | @cindex sftp (with sftp method) | ||
| 849 | @cindex ssh (with sftp method) | ||
| 850 | |||
| 851 | That is mostly the same method as @option{scp}, but using | ||
| 852 | @command{sftp} as transfer command. So the same remarks are valid. | ||
| 853 | |||
| 854 | This command does not work like @value{ftppackagename}, where | ||
| 855 | @command{ftp} is called interactively, and all commands are send from | ||
| 856 | within this session. Instead of, @command{ssh} is used for login. | ||
| 857 | |||
| 858 | This method supports the @samp{-p} hack. | ||
| 791 | 859 | ||
| 792 | 860 | ||
| 793 | @item @option{rsync} --- @command{ssh} and @command{rsync} | 861 | @item @option{rsync} --- @command{ssh} and @command{rsync} |
| @@ -805,7 +873,7 @@ transferring files that exist on both hosts, this advantage is lost if | |||
| 805 | the file exists only on one side of the connection. | 873 | the file exists only on one side of the connection. |
| 806 | 874 | ||
| 807 | The @command{rsync} based method may be considerably faster than the | 875 | The @command{rsync} based method may be considerably faster than the |
| 808 | @command{rcp} based methods when writing to the remote system. Reading | 876 | @command{rcp} based methods when writing to the remote system. Reading |
| 809 | files to the local machine is no faster than with a direct copy. | 877 | files to the local machine is no faster than with a direct copy. |
| 810 | 878 | ||
| 811 | This method supports the @samp{-p} hack. | 879 | This method supports the @samp{-p} hack. |
| @@ -866,7 +934,22 @@ This method is similar to @option{scp}, but it uses the | |||
| 866 | @command{pscp} for transferring the files. These programs are part | 934 | @command{pscp} for transferring the files. These programs are part |
| 867 | of PuTTY, an SSH implementation for Windows. | 935 | of PuTTY, an SSH implementation for Windows. |
| 868 | 936 | ||
| 869 | CCC: Does @command{plink} support the @samp{-p} hack? | 937 | This method supports the @samp{-P} hack. |
| 938 | |||
| 939 | |||
| 940 | @item @option{psftp} --- @command{plink} and @command{psftp} | ||
| 941 | @cindex method psftp | ||
| 942 | @cindex psftp method | ||
| 943 | @cindex psftp (with psftp method) | ||
| 944 | @cindex plink (with psftp method) | ||
| 945 | @cindex PuTTY (with psftp method) | ||
| 946 | |||
| 947 | As you would expect, this method is similar to @option{sftp}, but it | ||
| 948 | uses the @command{plink} command to connect to the remote host, and it | ||
| 949 | uses @command{psftp} for transferring the files. These programs are | ||
| 950 | part of PuTTY, an SSH implementation for Windows. | ||
| 951 | |||
| 952 | This method supports the @samp{-P} hack. | ||
| 870 | 953 | ||
| 871 | 954 | ||
| 872 | @item @option{fcp} --- @command{fsh} and @command{fcp} | 955 | @item @option{fcp} --- @command{fsh} and @command{fcp} |
| @@ -901,7 +984,7 @@ anyway. | |||
| 901 | @cindex method ftp | 984 | @cindex method ftp |
| 902 | @cindex ftp method | 985 | @cindex ftp method |
| 903 | 986 | ||
| 904 | This is not a native @value{tramp} method. Instead of, it forwards all | 987 | This is not a native @value{tramp} method. Instead of, it forwards all |
| 905 | requests to @value{ftppackagename}. | 988 | requests to @value{ftppackagename}. |
| 906 | @ifset xemacs | 989 | @ifset xemacs |
| 907 | This works only for unified filenames, see @ref{Issues}. | 990 | 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 | |||
| 935 | name, then a percent sign, then the domain name). So, to connect to | 1018 | name, then a percent sign, then the domain name). So, to connect to |
| 936 | the machine @code{melancholia} as user @code{daniel} of the domain | 1019 | the machine @code{melancholia} as user @code{daniel} of the domain |
| 937 | @code{BIZARRE}, and edit @file{.emacs} in the home directory (share | 1020 | @code{BIZARRE}, and edit @file{.emacs} in the home directory (share |
| 938 | @code{daniel$}) I would specify the filename | 1021 | @code{daniel$}) I would specify the filename @file{@trampfn{smb, |
| 939 | @file{@value{prefix}smb@value{postfixsinglehop}daniel%BIZARRE@@melancholia@value{postfix}/daniel$$/.emacs}. | 1022 | daniel%BIZARRE, melancholia, /daniel$$/.emacs}}. |
| 1023 | |||
| 1024 | Depending on the Windows domain configuration, a Windows user might be | ||
| 1025 | considered as domain user per default. In order to connect as local | ||
| 1026 | user, the WINS name of that machine must be given as domain name. | ||
| 1027 | Usually, it is the machine name in capital letters. In the example | ||
| 1028 | above, the local user @code{daniel} would be specified as | ||
| 1029 | @file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}. | ||
| 940 | 1030 | ||
| 941 | The domain name as well as the user name are optional. If no user | 1031 | The domain name as well as the user name are optional. If no user |
| 942 | name is specified at all, the anonymous user (without password | 1032 | name is specified at all, the anonymous user (without password |
| @@ -953,97 +1043,56 @@ name. | |||
| 953 | 1043 | ||
| 954 | @end table | 1044 | @end table |
| 955 | 1045 | ||
| 956 | @node Multi-hop Methods | ||
| 957 | @section Connecting to a remote host using multiple hops | ||
| 958 | @cindex multi-hop methods | ||
| 959 | @cindex methods, multi-hop | ||
| 960 | 1046 | ||
| 961 | Sometimes, the methods described before are not sufficient. Sometimes, | 1047 | @ifset emacsgw |
| 962 | it is not possible to connect to a remote host using a simple command. | 1048 | @node Gateway methods |
| 963 | For example, if you are in a secured network, you might have to log in | 1049 | @section Gateway methods |
| 964 | to a `bastion host' first before you can connect to the outside world. | 1050 | @cindex methods, gateway |
| 965 | Of course, the target host may also require a bastion host. The format | 1051 | @cindex gateway methods |
| 966 | of multi-hop filenames is slightly different than the format of normal | ||
| 967 | @value{tramp} methods. | ||
| 968 | |||
| 969 | @cindex method multi | ||
| 970 | @cindex multi method | ||
| 971 | A multi-hop file name specifies a method, a number of hops, and a | ||
| 972 | localname (path name on the remote system). The method name is always | ||
| 973 | @option{multi}. | ||
| 974 | |||
| 975 | Each hop consists of a @dfn{hop method} specification, a user name and | ||
| 976 | a host name. The hop method can be an inline method only. The | ||
| 977 | following hop methods are (currently) available: | ||
| 978 | |||
| 979 | @table @option | ||
| 980 | @item telnet | ||
| 981 | @cindex hop method telnet | ||
| 982 | @cindex telnet hop method | ||
| 983 | |||
| 984 | Uses the well-known @command{telnet} program to connect to the host. | ||
| 985 | Whereas user name and host name are supplied in the file name, the | ||
| 986 | user is queried for the password. | ||
| 987 | |||
| 988 | @item rsh | ||
| 989 | @cindex hop method rsh | ||
| 990 | @cindex rsh hop method | ||
| 991 | |||
| 992 | This uses @command{rsh} to connect to the host. You do not need to | ||
| 993 | enter a password unless @command{rsh} explicitly asks for it. | ||
| 994 | |||
| 995 | The variant @option{remsh} uses the @command{remsh} command. It | ||
| 996 | should be applied on machines where @command{remsh} is used instead of | ||
| 997 | @command{rsh}. | ||
| 998 | |||
| 999 | @item ssh | ||
| 1000 | @cindex hop method ssh | ||
| 1001 | @cindex ssh hop method | ||
| 1002 | |||
| 1003 | This uses @command{ssh} to connect to the host. You might have to enter | ||
| 1004 | a password or a pass phrase. | ||
| 1005 | |||
| 1006 | @item su | ||
| 1007 | @cindex hop method su | ||
| 1008 | @cindex su hop method | ||
| 1009 | |||
| 1010 | This method does not actually contact a different host, but it allows | ||
| 1011 | you to become a different user on the host you're currently on. This | ||
| 1012 | might be useful if you want to edit files as root, but the remote host | ||
| 1013 | does not allow remote root logins. In this case you can use | ||
| 1014 | @option{telnet}, @option{rsh} or @option{ssh} to connect to the | ||
| 1015 | remote host as a non-root user, then use an @option{su} hop to become | ||
| 1016 | root. But @option{su} need not be the last hop in a sequence, you could | ||
| 1017 | also use it somewhere in the middle, if the need arises. | ||
| 1018 | |||
| 1019 | Even though you @emph{must} specify both user and host with an | ||
| 1020 | @option{su} hop, the host name is ignored and only the user name is | ||
| 1021 | used. | ||
| 1022 | |||
| 1023 | @item sudo | ||
| 1024 | @cindex hop method sudo | ||
| 1025 | @cindex sudo hop method | ||
| 1026 | |||
| 1027 | This is similar to the @option{su} hop, except that it uses | ||
| 1028 | @command{sudo} rather than @command{su} to become a different user. | ||
| 1029 | 1052 | ||
| 1030 | @end table | 1053 | Gateway methods are not methods to access a remote host directly. |
| 1054 | These methods are intended to pass firewalls or proxy servers. | ||
| 1055 | Therefore, they can be used for proxy host declarations | ||
| 1056 | (@pxref{Multi-hops}) only. | ||
| 1031 | 1057 | ||
| 1032 | Some people might wish to use port forwarding with @command{ssh} or | 1058 | A gateway method must come always along with a method who supports |
| 1033 | maybe they have to use a nonstandard port. This can be accomplished | 1059 | port setting (referred to as @samp{-p} kludge). This is because |
| 1034 | by putting a stanza in @file{~/.ssh/config} for the account which | 1060 | @value{tramp} targets the accompanied method to |
| 1035 | specifies a different port number for a certain host name. But it can | 1061 | @file{localhost#random_port}, from where the firewall or proxy server |
| 1036 | also be accomplished within @value{tramp}, by adding a multi-hop method. | 1062 | is accessed to. |
| 1037 | For example: | ||
| 1038 | 1063 | ||
| 1039 | @lisp | 1064 | Gateway methods support user name and password declarations. These |
| 1040 | (add-to-list | 1065 | are used to authenticate towards the corresponding firewall or proxy |
| 1041 | 'tramp-multi-connection-function-alist | 1066 | server. They can be passed only if your friendly administrator has |
| 1042 | '("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n")) | 1067 | granted your access. |
| 1043 | @end lisp | 1068 | |
| 1069 | @table @asis | ||
| 1070 | @item @option{tunnel} | ||
| 1071 | @cindex method tunnel | ||
| 1072 | @cindex tunnel method | ||
| 1073 | |||
| 1074 | This method implements an HTTP tunnel via the @command{CONNECT} | ||
| 1075 | command (see RFC 2616, 2817). Any HTTP 1.1 compliant (proxy) server | ||
| 1076 | shall support this command. | ||
| 1077 | |||
| 1078 | As authentication method, only @option{Basic Authentication} (see RFC | ||
| 1079 | 2617) is implemented so far. If no port number is given in the | ||
| 1080 | declaration, port @option{8080} is used for the proxy server. | ||
| 1081 | |||
| 1082 | |||
| 1083 | @item @option{socks} | ||
| 1084 | @cindex method socks | ||
| 1085 | @cindex socks method | ||
| 1044 | 1086 | ||
| 1045 | Now you can use an @option{sshf} hop which connects to port 4400 instead of | 1087 | The @command{socks} method provides access to SOCKSv5 servers (see |
| 1046 | the standard port. | 1088 | RFC 1928). @option{Username/Password Authentication} according to RFC |
| 1089 | 1929 is supported. | ||
| 1090 | |||
| 1091 | The default port number of the socks server is @option{1080}, if not | ||
| 1092 | specified otherwise. | ||
| 1093 | |||
| 1094 | @end table | ||
| 1095 | @end ifset | ||
| 1047 | 1096 | ||
| 1048 | 1097 | ||
| 1049 | @node Default Method | 1098 | @node Default Method |
| @@ -1085,7 +1134,6 @@ methods, giving better performance. | |||
| 1085 | 1134 | ||
| 1086 | @xref{Inline methods}. | 1135 | @xref{Inline methods}. |
| 1087 | @xref{External transfer methods}. | 1136 | @xref{External transfer methods}. |
| 1088 | @xref{Multi-hop Methods}. | ||
| 1089 | 1137 | ||
| 1090 | Another consideration with the selection of transfer methods is the | 1138 | Another consideration with the selection of transfer methods is the |
| 1091 | environment you will use them in and, especially when used over the | 1139 | environment you will use them in and, especially when used over the |
| @@ -1098,7 +1146,7 @@ read from other machines. | |||
| 1098 | 1146 | ||
| 1099 | If you need to connect to remote systems that are accessible from the | 1147 | If you need to connect to remote systems that are accessible from the |
| 1100 | Internet, you should give serious thought to using @option{ssh} based | 1148 | Internet, you should give serious thought to using @option{ssh} based |
| 1101 | methods to connect. These provide a much higher level of security, | 1149 | methods to connect. These provide a much higher level of security, |
| 1102 | making it a non-trivial exercise for someone to obtain your password | 1150 | making it a non-trivial exercise for someone to obtain your password |
| 1103 | or read the content of the files you are editing. | 1151 | or read the content of the files you are editing. |
| 1104 | 1152 | ||
| @@ -1119,9 +1167,9 @@ to edit mostly small files. | |||
| 1119 | 1167 | ||
| 1120 | I guess that these days, most people can access a remote machine by | 1168 | I guess that these days, most people can access a remote machine by |
| 1121 | using @command{ssh}. So I suggest that you use the @option{ssh} | 1169 | using @command{ssh}. So I suggest that you use the @option{ssh} |
| 1122 | method. So, type @kbd{C-x C-f | 1170 | method. So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost, |
| 1123 | @value{prefix}ssh@value{postfixsinglehop}root@@otherhost@value{postfix}/etc/motd | 1171 | /etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other |
| 1124 | @key{RET}} to edit the @file{/etc/motd} file on the other host. | 1172 | host. |
| 1125 | 1173 | ||
| 1126 | If you can't use @option{ssh} to log in to the remote host, then | 1174 | If you can't use @option{ssh} to log in to the remote host, then |
| 1127 | select a method that uses a program that works. For instance, Windows | 1175 | 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 | |||
| 1132 | For the special case of editing files on the local host as another | 1180 | For the special case of editing files on the local host as another |
| 1133 | user, see the @option{su} or @option{sudo} methods. They offer | 1181 | user, see the @option{su} or @option{sudo} methods. They offer |
| 1134 | shortened syntax for the @samp{root} account, like | 1182 | shortened syntax for the @samp{root} account, like |
| 1135 | @file{@value{prefix}su@value{postfixsinglehop}@value{postfix}/etc/motd}. | 1183 | @file{@trampfnmhl{su, , /etc/motd}}. |
| 1136 | 1184 | ||
| 1137 | People who edit large files may want to consider @option{scp} instead | 1185 | People who edit large files may want to consider @option{scpc} instead |
| 1138 | of @option{ssh}, or @option{pscp} instead of @option{plink}. These | 1186 | of @option{ssh}, or @option{pscp} instead of @option{plink}. These |
| 1139 | out-of-band methods are faster than inline methods for large files. | 1187 | out-of-band methods are faster than inline methods for large files. |
| 1140 | Note, however, that out-of-band methods suffer from some limitations. | 1188 | 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 | |||
| 1143 | methods are fast enough. | 1191 | methods are fast enough. |
| 1144 | 1192 | ||
| 1145 | 1193 | ||
| 1194 | @node Default User | ||
| 1195 | @section Selecting a default user | ||
| 1196 | @cindex default user | ||
| 1197 | |||
| 1198 | The user part of a @value{tramp} file name can be omitted. Usually, | ||
| 1199 | it is replaced by the user name you are logged in. Often, this is not | ||
| 1200 | what you want. A typical use of @value{tramp} might be to edit some | ||
| 1201 | files with root permissions on the local host. This case, you should | ||
| 1202 | set the variable @code{tramp-default-user} to reflect that choice. | ||
| 1203 | For example: | ||
| 1204 | |||
| 1205 | @lisp | ||
| 1206 | (setq tramp-default-user "root") | ||
| 1207 | @end lisp | ||
| 1208 | |||
| 1209 | @code{tramp-default-user} is regarded as obsolete, and will be removed | ||
| 1210 | soon. | ||
| 1211 | |||
| 1212 | @vindex tramp-default-user-alist | ||
| 1213 | You can also specify different users for certain method/host | ||
| 1214 | combinations, via the variable @code{tramp-default-user-alist}. For | ||
| 1215 | example, if you always have to use the user @samp{john} in the domain | ||
| 1216 | @samp{somewhere.else}, you can specify the following: | ||
| 1217 | |||
| 1218 | @lisp | ||
| 1219 | (add-to-list 'tramp-default-user-alist | ||
| 1220 | '("ssh" ".*\\.somewhere\\.else\\'" "john")) | ||
| 1221 | @end lisp | ||
| 1222 | |||
| 1223 | @noindent | ||
| 1224 | See the documentation for the variable | ||
| 1225 | @code{tramp-default-user-alist} for more details. | ||
| 1226 | |||
| 1227 | One trap to fall in must be known. If @value{tramp} finds a default | ||
| 1228 | user, this user will be passed always to the connection command as | ||
| 1229 | parameter (for example @samp{ssh here.somewhere.else -l john}. If you | ||
| 1230 | have specified another user for your command in its configuration | ||
| 1231 | files, @value{tramp} cannot know it, and the remote access will fail. | ||
| 1232 | If you have specified in the given example in @file{~/.ssh/config} the | ||
| 1233 | lines | ||
| 1234 | |||
| 1235 | @example | ||
| 1236 | Host here.somewhere.else | ||
| 1237 | User lily | ||
| 1238 | @end example | ||
| 1239 | |||
| 1240 | @noindent | ||
| 1241 | than you must discard selecting a default user by @value{tramp}. This | ||
| 1242 | will be done by setting it to @code{nil} (or @samp{lily}, likewise): | ||
| 1243 | |||
| 1244 | @lisp | ||
| 1245 | (add-to-list 'tramp-default-user-alist | ||
| 1246 | '("ssh" "\\`here\\.somewhere\\.else\\'" nil)) | ||
| 1247 | @end lisp | ||
| 1248 | |||
| 1249 | The last entry in @code{tramp-default-user-alist} could be your | ||
| 1250 | default user you'll apply predominantly. You shall @emph{append} it | ||
| 1251 | to that list at the end: | ||
| 1252 | |||
| 1253 | @lisp | ||
| 1254 | (add-to-list 'tramp-default-user-alist '(nil nil "jonas") t) | ||
| 1255 | @end lisp | ||
| 1256 | |||
| 1257 | |||
| 1258 | @node Default Host | ||
| 1259 | @section Selecting a default host | ||
| 1260 | @cindex default host | ||
| 1261 | |||
| 1262 | @vindex tramp-default-host | ||
| 1263 | Finally, it is even possible to omit the host name part of a | ||
| 1264 | @value{tramp} file name. This case, the value of the variable | ||
| 1265 | @code{tramp-default-host} is used. Per default, it is initialized | ||
| 1266 | with the host name your local @value{emacsname} is running. | ||
| 1267 | |||
| 1268 | If you, for example, use @value{tramp} mainly to contact the host | ||
| 1269 | @samp{target} as user @samp{john}, you can specify: | ||
| 1270 | |||
| 1271 | @lisp | ||
| 1272 | (setq tramp-default-user "john" | ||
| 1273 | tramp-default-host "target") | ||
| 1274 | @end lisp | ||
| 1275 | |||
| 1276 | Then the simple file name @samp{@trampfnmhl{ssh,,}} will connect you | ||
| 1277 | to John's home directory on target. | ||
| 1278 | @ifset emacs | ||
| 1279 | Note, however, that the most simplification @samp{@trampfnmhl{,,}} | ||
| 1280 | won't work, because @samp{/:} is the prefix for quoted file names. | ||
| 1281 | @end ifset | ||
| 1282 | |||
| 1283 | |||
| 1284 | @node Multi-hops | ||
| 1285 | @section Connecting to a remote host using multiple hops | ||
| 1286 | @cindex multi-hop | ||
| 1287 | @cindex proxy hosts | ||
| 1288 | |||
| 1289 | Sometimes, the methods described before are not sufficient. Sometimes, | ||
| 1290 | it is not possible to connect to a remote host using a simple command. | ||
| 1291 | For example, if you are in a secured network, you might have to log in | ||
| 1292 | to a `bastion host' first before you can connect to the outside world. | ||
| 1293 | Of course, the target host may also require a bastion host. | ||
| 1294 | |||
| 1295 | @vindex tramp-default-proxies-alist | ||
| 1296 | In order to specify such multiple hops, it is possible to define a proxy | ||
| 1297 | host to pass through, via the variable | ||
| 1298 | @code{tramp-default-proxies-alist}. This variable keeps a list of | ||
| 1299 | triples (@var{host} @var{user} @var{proxy}). | ||
| 1300 | |||
| 1301 | The first matching item specifies the proxy host to be passed for a | ||
| 1302 | file name located on a remote target matching @var{user}@@@var{host}. | ||
| 1303 | @var{host} and @var{user} are regular expressions or @code{nil}, which | ||
| 1304 | is interpreted as a regular expression which always matches. | ||
| 1305 | |||
| 1306 | @var{proxy} must be a Tramp filename which localname part is ignored. | ||
| 1307 | Method and user name on @var{proxy} are optional, which is interpreted | ||
| 1308 | with the default values. | ||
| 1309 | @ifset emacsgw | ||
| 1310 | The method must be an inline or gateway method (@pxref{Inline | ||
| 1311 | methods}, @pxref{Gateway methods}). | ||
| 1312 | @end ifset | ||
| 1313 | @ifclear emacsgw | ||
| 1314 | The method must be an inline method (@pxref{Inline methods}). | ||
| 1315 | @end ifclear | ||
| 1316 | If @var{proxy} is @code{nil}, no additional hop is required reaching | ||
| 1317 | @var{user}@@@var{host}. | ||
| 1318 | |||
| 1319 | If you, for example, must pass the host @samp{bastion.your.domain} as | ||
| 1320 | user @samp{bird} for any remote host which is not located in your local | ||
| 1321 | domain, you can set | ||
| 1322 | |||
| 1323 | @lisp | ||
| 1324 | (add-to-list 'tramp-default-proxies-alist | ||
| 1325 | '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}")) | ||
| 1326 | (add-to-list 'tramp-default-proxies-alist | ||
| 1327 | '("\\.your\\.domain\\'" nil nil)) | ||
| 1328 | @end lisp | ||
| 1329 | |||
| 1330 | Please note the order of the code. @code{add-to-list} adds elements at the | ||
| 1331 | beginning of a list. Therefore, most relevant rules must be added last. | ||
| 1332 | |||
| 1333 | Proxy hosts can be cascaded. If there is another host called | ||
| 1334 | @samp{jump.your.domain}, which is the only one in your local domain who | ||
| 1335 | is allowed connecting @samp{bastion.your.domain}, you can add another | ||
| 1336 | rule: | ||
| 1337 | |||
| 1338 | @lisp | ||
| 1339 | (add-to-list 'tramp-default-proxies-alist | ||
| 1340 | '("\\`bastion\\.your\\.domain\\'" | ||
| 1341 | "\\`bird\\'" | ||
| 1342 | "@trampfnmhl{ssh, jump.your.domain,}")) | ||
| 1343 | @end lisp | ||
| 1344 | |||
| 1345 | @var{proxy} can contain the patterns @code{%h} or @code{%u}. These | ||
| 1346 | patterns are replaced by the strings matching @var{host} or | ||
| 1347 | @var{user}, respectively. | ||
| 1348 | |||
| 1349 | If you, for example, wants to work as @samp{root} on hosts in the | ||
| 1350 | domain @samp{your.domain}, but login as @samp{root} is disabled for | ||
| 1351 | non-local access, you might add the following rule: | ||
| 1352 | |||
| 1353 | @lisp | ||
| 1354 | (add-to-list 'tramp-default-proxies-alist | ||
| 1355 | '("\\.your\\.domain\\'" "\\`root\\'" "@trampfnmhl{ssh, %h,}")) | ||
| 1356 | @end lisp | ||
| 1357 | |||
| 1358 | Opening @file{@trampfnmhl{sudo, randomhost.your.domain,}} would | ||
| 1359 | connect first @samp{randomhost.your.domain} via @code{ssh} under your | ||
| 1360 | account name, and perform @code{sudo -u root} on that host afterwards. | ||
| 1361 | It is important to know that the given method is applied on the host | ||
| 1362 | which has been reached so far. @code{sudo -u root}, applied on your | ||
| 1363 | local host, wouldn't be useful here. | ||
| 1364 | |||
| 1365 | This is the recommended configuration to work as @samp{root} on remote | ||
| 1366 | Ubuntu hosts. | ||
| 1367 | |||
| 1368 | @ifset emacsgw | ||
| 1369 | Finally, @code{tramp-default-proxies-alist} can be used to pass | ||
| 1370 | firewalls or proxy servers. Imagine your local network has a host | ||
| 1371 | @samp{proxy.your.domain} which is used on port 3128 as HTTP proxy to | ||
| 1372 | the outer world. Your friendly administrator has granted you access | ||
| 1373 | under your user name to @samp{host.other.domain} on that proxy | ||
| 1374 | server.@footnote{HTTP tunnels are intended for secure SSL/TLS | ||
| 1375 | communication. Therefore, many proxy server restrict the tunnels to | ||
| 1376 | related target ports. You might need to run your ssh server on your | ||
| 1377 | target host @samp{host.other.domain} on such a port, like 443 (https). | ||
| 1378 | See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall} | ||
| 1379 | for discussion of ethical issues.} You would need to add the | ||
| 1380 | following rule: | ||
| 1381 | |||
| 1382 | @lisp | ||
| 1383 | (add-to-list 'tramp-default-proxies-alist | ||
| 1384 | '("\\`host\\.other\\.domain\\'" nil | ||
| 1385 | "@trampfnmhl{tunnel, proxy.your.domain#3128,}")) | ||
| 1386 | @end lisp | ||
| 1387 | |||
| 1388 | Gateway methods can be declared as first hop only in a multiple hop | ||
| 1389 | chain. | ||
| 1390 | @end ifset | ||
| 1391 | |||
| 1392 | |||
| 1146 | @node Customizing Methods | 1393 | @node Customizing Methods |
| 1147 | @section Using Non-Standard Methods | 1394 | @section Using Non-Standard Methods |
| 1148 | @cindex customizing methods | 1395 | @cindex customizing methods |
| @@ -1263,8 +1510,8 @@ you might provide such a function as well. This function must meet | |||
| 1263 | the following conventions: | 1510 | the following conventions: |
| 1264 | 1511 | ||
| 1265 | @defun my-tramp-parse file | 1512 | @defun my-tramp-parse file |
| 1266 | @var{file} must be either a file name on your host, or @code{nil}. The | 1513 | @var{file} must be either a file name on your host, or @code{nil}. |
| 1267 | function must return a list of (@var{user} @var{host}), which are | 1514 | The function must return a list of (@var{user} @var{host}), which are |
| 1268 | taken as candidates for user and host name completion. | 1515 | taken as candidates for user and host name completion. |
| 1269 | 1516 | ||
| 1270 | Example: | 1517 | Example: |
| @@ -1309,16 +1556,44 @@ can be disabled totally by customizing the variable | |||
| 1309 | @code{password-cache} (setting it to @code{nil}). | 1556 | @code{password-cache} (setting it to @code{nil}). |
| 1310 | 1557 | ||
| 1311 | Implementation Note: password caching is based on the package | 1558 | Implementation Note: password caching is based on the package |
| 1312 | password.el in No Gnus. For the time being, it is activated only when | 1559 | @file{password.el} in No Gnus. For the time being, it is activated |
| 1313 | this package is seen in the @code{load-path} while loading @value{tramp}. | 1560 | only when this package is seen in the @code{load-path} while loading |
| 1561 | @value{tramp}. | ||
| 1314 | @ifset installchapter | 1562 | @ifset installchapter |
| 1315 | If you don't use No Gnus, you can take password.el from the @value{tramp} | 1563 | If you don't use No Gnus, you can take @file{password.el} from the |
| 1316 | @file{contrib} directory, see @ref{Installation parameters}. | 1564 | @value{tramp} @file{contrib} directory, see @ref{Installation |
| 1565 | parameters}. | ||
| 1317 | @end ifset | 1566 | @end ifset |
| 1318 | It will be activated mandatory once No Gnus has found its way into | 1567 | It will be activated mandatory once No Gnus has found its way into |
| 1319 | @value{emacsname}. | 1568 | @value{emacsname}. |
| 1320 | 1569 | ||
| 1321 | 1570 | ||
| 1571 | @node Connection caching | ||
| 1572 | @section Reusing connection related information. | ||
| 1573 | @cindex caching | ||
| 1574 | |||
| 1575 | @vindex tramp-persistency-file-name | ||
| 1576 | In order to reduce initial connection time, @value{tramp} stores | ||
| 1577 | connection related information persistently. The variable | ||
| 1578 | @code{tramp-persistency-file-name} keeps the file name where these | ||
| 1579 | information are written. Its default value is | ||
| 1580 | @ifset emacs | ||
| 1581 | @file{~/.emacs.d/tramp}. | ||
| 1582 | @end ifset | ||
| 1583 | @ifset xemacs | ||
| 1584 | @file{~/.xemacs/tramp}. | ||
| 1585 | @end ifset | ||
| 1586 | It is recommended to choose a local file name. | ||
| 1587 | |||
| 1588 | @value{tramp} reads this file during startup, and writes it when | ||
| 1589 | exiting @value{emacsname}. You can simply remove this file if | ||
| 1590 | @value{tramp} shall be urged to recompute these information next | ||
| 1591 | @value{emacsname} startup time. | ||
| 1592 | |||
| 1593 | Using such persistent information can be disabled by setting | ||
| 1594 | @code{tramp-persistency-file-name} to @code{nil}. | ||
| 1595 | |||
| 1596 | |||
| 1322 | @node Remote Programs | 1597 | @node Remote Programs |
| 1323 | @section How @value{tramp} finds and uses programs on the remote machine. | 1598 | @section How @value{tramp} finds and uses programs on the remote machine. |
| 1324 | 1599 | ||
| @@ -1327,25 +1602,32 @@ function, including @command{ls}, @command{test}, @command{find} and | |||
| 1327 | @command{cat}. | 1602 | @command{cat}. |
| 1328 | 1603 | ||
| 1329 | In addition to these required tools, there are various tools that may be | 1604 | In addition to these required tools, there are various tools that may be |
| 1330 | required based on the connection method. See @ref{Inline methods} and | 1605 | required based on the connection method. See @ref{Inline methods} and |
| 1331 | @ref{External transfer methods} for details on these. | 1606 | @ref{External transfer methods} for details on these. |
| 1332 | 1607 | ||
| 1333 | Certain other tools, such as @command{perl} (or @command{perl5}) and | 1608 | Certain other tools, such as @command{perl} (or @command{perl5}) and |
| 1334 | @command{grep} will be used if they can be found. When they are | 1609 | @command{grep} will be used if they can be found. When they are |
| 1335 | available, they are used to improve the performance and accuracy of | 1610 | available, they are used to improve the performance and accuracy of |
| 1336 | remote file access. | 1611 | remote file access. |
| 1337 | 1612 | ||
| 1338 | @vindex tramp-remote-path | 1613 | @vindex tramp-remote-path |
| 1339 | When @value{tramp} connects to the remote machine, it searches for the | 1614 | When @value{tramp} connects to the remote machine, it searches for the |
| 1340 | programs that it can use. The variable @var{tramp-remote-path} controls | 1615 | programs that it can use. The variable @code{tramp-remote-path} |
| 1341 | the directories searched on the remote machine. | 1616 | controls the directories searched on the remote machine. |
| 1342 | 1617 | ||
| 1343 | By default, this is set to a reasonable set of defaults for most | 1618 | By default, this is set to a reasonable set of defaults for most |
| 1344 | machines. It is possible, however, that your local (or remote ;) system | 1619 | machines. The symbol @code{tramp-default-remote-path} is a place |
| 1620 | holder, it is replaced by the list of directories received via the | ||
| 1621 | command @command{getconf PATH} on your remote machine. For example, | ||
| 1622 | on GNU Debian this is @file{/bin:/usr/bin}, whereas on Solaris this is | ||
| 1623 | @file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}. It is | ||
| 1624 | recommended to apply this symbol on top of @code{tramp-remote-path}. | ||
| 1625 | |||
| 1626 | It is possible, however, that your local (or remote ;) system | ||
| 1345 | administrator has put the tools you want in some obscure local | 1627 | administrator has put the tools you want in some obscure local |
| 1346 | directory. | 1628 | directory. |
| 1347 | 1629 | ||
| 1348 | In this case, you can still use them with @value{tramp}. You simply need to | 1630 | In this case, you can still use them with @value{tramp}. You simply need to |
| 1349 | add code to your @file{.emacs} to add the directory to the remote path. | 1631 | add code to your @file{.emacs} to add the directory to the remote path. |
| 1350 | This will then be searched by @value{tramp} when you connect and the software | 1632 | This will then be searched by @value{tramp} when you connect and the software |
| 1351 | found. | 1633 | found. |
| @@ -1433,20 +1715,37 @@ circumstances. | |||
| 1433 | 1715 | ||
| 1434 | Some people invoke the @command{tset} program from their shell startup | 1716 | Some people invoke the @command{tset} program from their shell startup |
| 1435 | scripts which asks the user about the terminal type of the shell. | 1717 | scripts which asks the user about the terminal type of the shell. |
| 1436 | Maybe some shells ask other questions when they are started. @value{tramp} | 1718 | Maybe some shells ask other questions when they are started. |
| 1437 | does not know how to answer these questions. There are two approaches | 1719 | @value{tramp} does not know how to answer these questions. There are |
| 1438 | for dealing with this problem. One approach is to take care that the | 1720 | two approaches for dealing with this problem. One approach is to take |
| 1439 | shell does not ask any questions when invoked from @value{tramp}. You can | 1721 | care that the shell does not ask any questions when invoked from |
| 1440 | do this by checking the @code{TERM} environment variable, it will be | 1722 | @value{tramp}. You can do this by checking the @code{TERM} |
| 1441 | set to @code{dumb} when connecting. | 1723 | environment variable, it will be set to @code{dumb} when connecting. |
| 1442 | 1724 | ||
| 1443 | @vindex tramp-terminal-type | 1725 | @vindex tramp-terminal-type |
| 1444 | The variable @code{tramp-terminal-type} can be used to change this value | 1726 | The variable @code{tramp-terminal-type} can be used to change this value |
| 1445 | to @code{dumb}. | 1727 | to @code{dumb}. |
| 1446 | 1728 | ||
| 1729 | @vindex tramp-actions-before-shell | ||
| 1447 | The other approach is to teach @value{tramp} about these questions. See | 1730 | The other approach is to teach @value{tramp} about these questions. See |
| 1448 | the variables @code{tramp-actions-before-shell} and | 1731 | the variable @code{tramp-actions-before-shell}. Example: |
| 1449 | @code{tramp-multi-actions} (for multi-hop connections). | 1732 | |
| 1733 | @lisp | ||
| 1734 | (defconst my-tramp-prompt-regexp | ||
| 1735 | (concat (regexp-opt '("Enter the birth date of your mother:") t) | ||
| 1736 | "\\s-*") | ||
| 1737 | "Regular expression matching my login prompt question.") | ||
| 1738 | |||
| 1739 | (defun my-tramp-action (proc vec) | ||
| 1740 | "Enter \"19000101\" in order to give a correct answer." | ||
| 1741 | (save-window-excursion | ||
| 1742 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 1743 | (tramp-message vec 6 "\n%s" (buffer-string)) | ||
| 1744 | (tramp-send-string vec "19000101")))) | ||
| 1745 | |||
| 1746 | (add-to-list 'tramp-actions-before-shell | ||
| 1747 | '(my-tramp-prompt-regexp my-tramp-action)) | ||
| 1748 | @end lisp | ||
| 1450 | 1749 | ||
| 1451 | 1750 | ||
| 1452 | @item Environment variables named like users in @file{.profile} | 1751 | @item Environment variables named like users in @file{.profile} |
| @@ -1484,10 +1783,10 @@ of the single character tilde, strange things will happen. | |||
| 1484 | 1783 | ||
| 1485 | What can you do about this? | 1784 | What can you do about this? |
| 1486 | 1785 | ||
| 1487 | Well, one possibility is to make sure that everything in @file{~/.shrc} | 1786 | Well, one possibility is to make sure that everything in |
| 1488 | and @file{~/.profile} on all remote hosts is Bourne-compatible. In the | 1787 | @file{~/.shrc} and @file{~/.profile} on all remote hosts is |
| 1489 | above example, instead of @command{export FOO=bar}, you might use | 1788 | Bourne-compatible. In the above example, instead of @command{export |
| 1490 | @command{FOO=bar; export FOO} instead. | 1789 | FOO=bar}, you might use @command{FOO=bar; export FOO} instead. |
| 1491 | 1790 | ||
| 1492 | The other possibility is to put your non-Bourne shell setup into some | 1791 | The other possibility is to put your non-Bourne shell setup into some |
| 1493 | other files. For example, bash reads the file @file{~/.bash_profile} | 1792 | other files. For example, bash reads the file @file{~/.bash_profile} |
| @@ -1528,13 +1827,13 @@ variable | |||
| 1528 | @ifset xemacs | 1827 | @ifset xemacs |
| 1529 | @code{bkup-backup-directory-info}. | 1828 | @code{bkup-backup-directory-info}. |
| 1530 | @end ifset | 1829 | @end ifset |
| 1531 | In connection with @value{tramp}, this can have unexpected side effects. | 1830 | In connection with @value{tramp}, this can have unexpected side |
| 1532 | Suppose that you specify that all backups should go to the directory | 1831 | effects. Suppose that you specify that all backups should go to the |
| 1533 | @file{~/.emacs.d/backups/}, and then you edit the file | 1832 | directory @file{~/.emacs.d/backups/}, and then you edit the file |
| 1534 | @file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile}. | 1833 | @file{@trampfn{su, root, localhost, /etc/secretfile}}. The effect is |
| 1535 | The effect is that the backup file will be owned by you and not by | 1834 | that the backup file will be owned by you and not by root, thus |
| 1536 | root, thus possibly enabling others to see it even if they were not | 1835 | possibly enabling others to see it even if they were not intended to |
| 1537 | intended to see it. | 1836 | see it. |
| 1538 | 1837 | ||
| 1539 | When | 1838 | When |
| 1540 | @ifset emacs | 1839 | @ifset emacs |
| @@ -1608,14 +1907,15 @@ Example: | |||
| 1608 | @end ifset | 1907 | @end ifset |
| 1609 | 1908 | ||
| 1610 | @noindent | 1909 | @noindent |
| 1611 | The backup file name of | 1910 | The backup file name of @file{@trampfn{su, root, localhost, |
| 1612 | @file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile} | 1911 | /etc/secretfile}} would be |
| 1613 | would be | ||
| 1614 | @ifset emacs | 1912 | @ifset emacs |
| 1615 | @file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~} | 1913 | @file{@trampfn{su, root, localhost, |
| 1914 | ~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}} | ||
| 1616 | @end ifset | 1915 | @end ifset |
| 1617 | @ifset xemacs | 1916 | @ifset xemacs |
| 1618 | @file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~} | 1917 | @file{@trampfn{su, root, localhost, |
| 1918 | ~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}} | ||
| 1619 | @end ifset | 1919 | @end ifset |
| 1620 | 1920 | ||
| 1621 | The same problem can happen with auto-saving files. | 1921 | The same problem can happen with auto-saving files. |
| @@ -1669,8 +1969,8 @@ can find information about setting up Cygwin in their FAQ at | |||
| 1669 | If you wish to use the @option{scpx} connection method, then you might | 1969 | If you wish to use the @option{scpx} connection method, then you might |
| 1670 | have the problem that @value{emacsname} calls @command{scp} with a | 1970 | have the problem that @value{emacsname} calls @command{scp} with a |
| 1671 | Windows filename such as @code{c:/foo}. The Cygwin version of | 1971 | Windows filename such as @code{c:/foo}. The Cygwin version of |
| 1672 | @command{scp} does not know about Windows filenames and interprets this | 1972 | @command{scp} does not know about Windows filenames and interprets |
| 1673 | as a remote filename on the host @code{c}. | 1973 | this as a remote filename on the host @code{c}. |
| 1674 | 1974 | ||
| 1675 | One possible workaround is to write a wrapper script for @option{scp} | 1975 | One possible workaround is to write a wrapper script for @option{scp} |
| 1676 | which converts the Windows filename to a Cygwinized filename. | 1976 | which converts the Windows filename to a Cygwinized filename. |
| @@ -1696,9 +1996,9 @@ know anything at all about Windows@dots{} | |||
| 1696 | @chapter Using @value{tramp} | 1996 | @chapter Using @value{tramp} |
| 1697 | @cindex using @value{tramp} | 1997 | @cindex using @value{tramp} |
| 1698 | 1998 | ||
| 1699 | Once you have installed @value{tramp} it will operate fairly transparently. You | 1999 | Once you have installed @value{tramp} it will operate fairly |
| 1700 | will be able to access files on any remote machine that you can log in | 2000 | transparently. You will be able to access files on any remote machine |
| 1701 | to as though they were local. | 2001 | that you can log in to as though they were local. |
| 1702 | 2002 | ||
| 1703 | Files are specified to @value{tramp} using a formalized syntax specifying the | 2003 | Files are specified to @value{tramp} using a formalized syntax specifying the |
| 1704 | details of the system to connect to. This is similar to the syntax used | 2004 | details of the system to connect to. This is similar to the syntax used |
| @@ -1717,10 +2017,9 @@ minute you have already forgotten that you hit that key! | |||
| 1717 | 2017 | ||
| 1718 | @menu | 2018 | @menu |
| 1719 | * Filename Syntax:: @value{tramp} filename conventions. | 2019 | * Filename Syntax:: @value{tramp} filename conventions. |
| 1720 | * Multi-hop filename syntax:: Multi-hop filename conventions. | 2020 | * Alternative Syntax:: URL-like filename syntax. |
| 1721 | * Filename completion:: Filename completion. | 2021 | * Filename completion:: Filename completion. |
| 1722 | * Dired:: Dired. | 2022 | * Remote processes:: Integration with other @value{emacsname} packages (@sc{experimental}). |
| 1723 | * Compilation:: Compile remote files. | ||
| 1724 | @end menu | 2023 | @end menu |
| 1725 | 2024 | ||
| 1726 | 2025 | ||
| @@ -1729,123 +2028,107 @@ minute you have already forgotten that you hit that key! | |||
| 1729 | @cindex filename syntax | 2028 | @cindex filename syntax |
| 1730 | @cindex filename examples | 2029 | @cindex filename examples |
| 1731 | 2030 | ||
| 1732 | To access the file @var{localname} on the remote machine @var{machine} you | 2031 | To access the file @var{localname} on the remote machine @var{machine} |
| 1733 | would specify the filename | 2032 | you would specify the filename @file{@trampfnhl{@var{machine}, |
| 1734 | @file{@value{prefix}@var{machine}@value{postfix}@var{localname}}. | 2033 | @var{localname}}}. This will connect to @var{machine} and transfer |
| 1735 | This will connect to @var{machine} and transfer the file using the | 2034 | the file using the default method. @xref{Default Method}. |
| 1736 | default method. @xref{Default Method}. | ||
| 1737 | 2035 | ||
| 1738 | Some examples of @value{tramp} filenames are shown below. | 2036 | Some examples of @value{tramp} filenames are shown below. |
| 1739 | 2037 | ||
| 1740 | @table @file | 2038 | @table @file |
| 1741 | @item @value{prefix}melancholia@value{postfix}.emacs | 2039 | @item @trampfnhl{melancholia, .emacs} |
| 1742 | Edit the file @file{.emacs} in your home directory on the machine | 2040 | Edit the file @file{.emacs} in your home directory on the machine |
| 1743 | @code{melancholia}. | 2041 | @code{melancholia}. |
| 1744 | 2042 | ||
| 1745 | @item @value{prefix}melancholia.danann.net@value{postfix}.emacs | 2043 | @item @trampfnhl{melancholia.danann.net, .emacs} |
| 1746 | This edits the same file, using the fully qualified domain name of | 2044 | This edits the same file, using the fully qualified domain name of |
| 1747 | the machine. | 2045 | the machine. |
| 1748 | 2046 | ||
| 1749 | @item @value{prefix}melancholia@value{postfix}~/.emacs | 2047 | @item @trampfnhl{melancholia, ~/.emacs} |
| 1750 | This also edits the same file --- the @file{~} is expanded to your | 2048 | This also edits the same file --- the @file{~} is expanded to your |
| 1751 | home directory on the remote machine, just like it is locally. | 2049 | home directory on the remote machine, just like it is locally. |
| 1752 | 2050 | ||
| 1753 | @item @value{prefix}melancholia@value{postfix}~daniel/.emacs | 2051 | @item @trampfnhl{melancholia, ~daniel/.emacs} |
| 1754 | This edits the file @file{.emacs} in the home directory of the user | 2052 | This edits the file @file{.emacs} in the home directory of the user |
| 1755 | @code{daniel} on the machine @code{melancholia}. The @file{~<user>} | 2053 | @code{daniel} on the machine @code{melancholia}. The @file{~<user>} |
| 1756 | construct is expanded to the home directory of that user on the remote | 2054 | construct is expanded to the home directory of that user on the remote |
| 1757 | machine. | 2055 | machine. |
| 1758 | 2056 | ||
| 1759 | @item @value{prefix}melancholia@value{postfix}/etc/squid.conf | 2057 | @item @trampfnhl{melancholia, /etc/squid.conf} |
| 1760 | This edits the file @file{/etc/squid.conf} on the machine | 2058 | This edits the file @file{/etc/squid.conf} on the machine |
| 1761 | @code{melancholia}. | 2059 | @code{melancholia}. |
| 1762 | 2060 | ||
| 1763 | @end table | 2061 | @end table |
| 1764 | 2062 | ||
| 1765 | Unless you specify a different name to use, @value{tramp} will use the | 2063 | Unless you specify a different name to use, @value{tramp} will use the |
| 1766 | current local user name as the remote user name to log in with. If you | 2064 | current local user name as the remote user name to log in with. If you |
| 1767 | need to log in as a different user, you can specify the user name as | 2065 | need to log in as a different user, you can specify the user name as |
| 1768 | part of the filename. | 2066 | part of the filename. |
| 1769 | 2067 | ||
| 1770 | To log in to the remote machine as a specific user, you use the syntax | 2068 | To log in to the remote machine as a specific user, you use the syntax |
| 1771 | @file{@value{prefix}@var{user}@@@var{machine}@value{postfix}/@var{path/to.file}}. | 2069 | @file{@trampfnuhl{@var{user}, @var{machine}, @var{path/to.file}}}. |
| 1772 | That means that connecting to @code{melancholia} as @code{daniel} and | 2070 | That means that connecting to @code{melancholia} as @code{daniel} and |
| 1773 | editing @file{.emacs} in your home directory you would specify | 2071 | editing @file{.emacs} in your home directory you would specify |
| 1774 | @file{@value{prefix}daniel@@melancholia@value{postfix}.emacs}. | 2072 | @file{@trampfnuhl{daniel, melancholia, .emacs}}. |
| 1775 | 2073 | ||
| 1776 | It is also possible to specify other file transfer methods | 2074 | It is also possible to specify other file transfer methods |
| 1777 | (@pxref{Default Method}) as part of the filename. | 2075 | (@pxref{Default Method}) as part of the filename. |
| 1778 | @ifset emacs | 2076 | @ifset emacs |
| 1779 | This is done by putting the method before the user and host name, as | 2077 | This is done by putting the method before the user and host name, as |
| 1780 | in | 2078 | in @file{@value{prefix}@var{method}@value{postfixhop}} (Note the |
| 1781 | @file{@value{prefix}@var{method}@value{postfixsinglehop}} | 2079 | trailing colon). |
| 1782 | (Note the trailing colon). | ||
| 1783 | @end ifset | 2080 | @end ifset |
| 1784 | @ifset xemacs | 2081 | @ifset xemacs |
| 1785 | This is done by replacing the initial | 2082 | This is done by replacing the initial @file{@value{prefix}} with |
| 1786 | @file{@value{prefix}} with | 2083 | @file{@value{prefix}<method>@value{postfixhop}}. (Note the trailing |
| 1787 | @file{@value{prefix}<method>@value{postfixsinglehop}}. | 2084 | slash!). |
| 1788 | (Note the trailing slash!). | ||
| 1789 | @end ifset | 2085 | @end ifset |
| 1790 | The user, machine and file specification remain the same. | 2086 | The user, machine and file specification remain the same. |
| 1791 | 2087 | ||
| 1792 | So, to connect to the machine @code{melancholia} as @code{daniel}, | 2088 | So, to connect to the machine @code{melancholia} as @code{daniel}, |
| 1793 | using the @option{ssh} method to transfer files, and edit @file{.emacs} | 2089 | using the @option{ssh} method to transfer files, and edit |
| 1794 | in my home directory I would specify the filename | 2090 | @file{.emacs} in my home directory I would specify the filename |
| 1795 | @file{@value{prefix}ssh@value{postfixsinglehop}daniel@@melancholia@value{postfix}.emacs}. | 2091 | @file{@trampfn{ssh, daniel, melancholia, .emacs}}. |
| 1796 | |||
| 1797 | 2092 | ||
| 1798 | @node Multi-hop filename syntax | ||
| 1799 | @section Multi-hop filename conventions | ||
| 1800 | @cindex filename syntax for multi-hop files | ||
| 1801 | @cindex multi-hop filename syntax | ||
| 1802 | 2093 | ||
| 1803 | The syntax of multi-hop file names is necessarily slightly different | 2094 | @node Alternative Syntax |
| 1804 | than the syntax of other @value{tramp} file names. Here's an example | 2095 | @section URL-like filename syntax |
| 1805 | multi-hop file name: | 2096 | @cindex filename syntax |
| 2097 | @cindex filename examples | ||
| 1806 | 2098 | ||
| 1807 | @example | 2099 | Additionally to the syntax described in the previous chapter, it is |
| 1808 | @value{prefix}multi@value{postfixsinglehop}rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host@value{postfix}/path/to.file | 2100 | possible to use a URL-like syntax for @value{tramp}. This can be |
| 1809 | @end example | 2101 | switched on by customizing the variable @code{tramp-syntax}. Please |
| 2102 | note that this feature is experimental for the time being. | ||
| 1810 | 2103 | ||
| 1811 | This is quite a mouthful. So let's go through it step by step. The | 2104 | The variable @code{tramp-syntax} must be set before requiring @value{tramp}: |
| 1812 | file name consists of three parts. | ||
| 1813 | @ifset emacs | ||
| 1814 | The parts are separated by colons | ||
| 1815 | @end ifset | ||
| 1816 | @ifset xemacs | ||
| 1817 | The parts are separated by slashes and square brackets. | ||
| 1818 | @end ifset | ||
| 1819 | The first part is @file{@value{prefix}multi}, the method | ||
| 1820 | specification. The second part is | ||
| 1821 | @file{rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host} | ||
| 1822 | and specifies the hops. The final part is @file{/path/to.file} and | ||
| 1823 | specifies the file name on the remote host. | ||
| 1824 | 2105 | ||
| 1825 | The first part and the final part should be clear. See @ref{Multi-hop | 2106 | @lisp |
| 1826 | Methods}, for a list of alternatives for the method specification. | 2107 | (setq tramp-syntax 'url) |
| 2108 | (require 'tramp) | ||
| 2109 | @end lisp | ||
| 1827 | 2110 | ||
| 1828 | The second part can be subdivided again into components, so-called | 2111 | Then, a @value{tramp} filename would look like this: |
| 1829 | hops. In the above file name, there are two hops, | 2112 | @file{/@var{method}://@var{user}@@@var{machine}:@var{port}/@var{path/to.file}}. |
| 1830 | @file{rsh@value{postfixmultihop}out@@gate} and | 2113 | @file{/@var{method}://} is mandatory, all other parts are optional. |
| 1831 | @file{telnet@value{postfixmultihop}kai@@real.host}. | 2114 | @file{:@var{port}} is useful for methods only who support this. |
| 1832 | 2115 | ||
| 1833 | Each hop can @emph{again} be subdivided into (three) components, the | 2116 | The last example from the previous section would look like this: |
| 1834 | @dfn{hop method}, the @dfn{user name} and the @dfn{host name}. The | 2117 | @file{/ssh://daniel@@melancholia/.emacs}. |
| 1835 | meaning of the second and third component should be clear, and the hop | ||
| 1836 | method says what program to use to perform that hop. | ||
| 1837 | 2118 | ||
| 1838 | The first hop, @file{rsh@value{postfixmultihop}out@@gate}, | 2119 | For the time being, @code{tramp-syntax} can have the following values: |
| 1839 | says to use @command{rsh} to log in as user @code{out} to the host | ||
| 1840 | @code{gate}. Starting at that host, the second hop, | ||
| 1841 | @file{telnet@value{postfixmultihop}kai@@real.host}, says to | ||
| 1842 | use @command{telnet} to log in as user @code{kai} to host | ||
| 1843 | @code{real.host}. | ||
| 1844 | 2120 | ||
| 1845 | @xref{Multi-hop Methods}, for a list of possible hop method values. | 2121 | @itemize @w{} |
| 1846 | The variable @code{tramp-multi-connection-function-alist} contains the | 2122 | @ifset emacs |
| 1847 | list of possible hop methods and information on how to execute them, | 2123 | @item @code{ftp} -- That is the default syntax |
| 1848 | should you want to add your own. | 2124 | @item @code{url} -- URL-like syntax |
| 2125 | @end ifset | ||
| 2126 | @ifset xemacs | ||
| 2127 | @item @code{sep} -- That is the default syntax | ||
| 2128 | @item @code{url} -- URL-like syntax | ||
| 2129 | @item @code{ftp} -- EFS-like syntax | ||
| 2130 | @end ifset | ||
| 2131 | @end itemize | ||
| 1849 | 2132 | ||
| 1850 | 2133 | ||
| 1851 | @node Filename completion | 2134 | @node Filename completion |
| @@ -1853,10 +2136,20 @@ should you want to add your own. | |||
| 1853 | @cindex filename completion | 2136 | @cindex filename completion |
| 1854 | 2137 | ||
| 1855 | Filename completion works with @value{tramp} for completion of method | 2138 | Filename completion works with @value{tramp} for completion of method |
| 1856 | names, of user names and of machine names (except multi-hop methods) | 2139 | names, of user names and of machine names as well as for completion of |
| 1857 | as well as for completion of file names on remote machines. | 2140 | file names on remote machines. |
| 1858 | @ifset emacs | 2141 | @ifset emacs |
| 1859 | In order to enable this, Partial Completion mode must be set on. | 2142 | In order to enable this, Partial Completion mode must be set |
| 2143 | on@footnote{If you don't use Partial Completion mode, but want to | ||
| 2144 | keep full completion, load @value{tramp} like this in your | ||
| 2145 | @file{.emacs}: | ||
| 2146 | |||
| 2147 | @lisp | ||
| 2148 | ;; Preserve Tramp's completion features. | ||
| 2149 | (let ((partial-completion-mode t)) | ||
| 2150 | (require 'tramp)) | ||
| 2151 | @end lisp | ||
| 2152 | }. | ||
| 1860 | @ifinfo | 2153 | @ifinfo |
| 1861 | @xref{Completion Options, , , @value{emacsdir}}. | 2154 | @xref{Completion Options, , , @value{emacsdir}}. |
| 1862 | @end ifinfo | 2155 | @end ifinfo |
| @@ -1867,85 +2160,153 @@ If you, for example, type @kbd{C-x C-f @value{prefix}t | |||
| 1867 | 2160 | ||
| 1868 | @example | 2161 | @example |
| 1869 | @ifset emacs | 2162 | @ifset emacs |
| 1870 | @value{prefixsinglehop}telnet@value{postfixsinglehop} tmp/ | 2163 | @value{prefixhop}telnet@value{postfixhop} tmp/ |
| 1871 | @value{prefixsinglehop}toto@value{postfix} | 2164 | @value{prefixhop}toto@value{postfix} |
| 1872 | @end ifset | 2165 | @end ifset |
| 1873 | @ifset xemacs | 2166 | @ifset xemacs |
| 1874 | @value{prefixsinglehop}telnet@value{postfixsinglehop} @value{prefixsinglehop}toto@value{postfix} | 2167 | @value{prefixhop}telnet@value{postfixhop} @value{prefixhop}toto@value{postfix} |
| 1875 | @end ifset | 2168 | @end ifset |
| 1876 | @end example | 2169 | @end example |
| 1877 | 2170 | ||
| 1878 | @samp{@value{prefixsinglehop}telnet@value{postfixsinglehop}} | 2171 | @samp{@value{prefixhop}telnet@value{postfixhop}} |
| 1879 | is a possible completion for the respective method, | 2172 | is a possible completion for the respective method, |
| 1880 | @ifset emacs | 2173 | @ifset emacs |
| 1881 | @samp{tmp/} stands for the directory @file{/tmp} on your local | 2174 | @samp{tmp/} stands for the directory @file{/tmp} on your local |
| 1882 | machine, | 2175 | machine, |
| 1883 | @end ifset | 2176 | @end ifset |
| 1884 | and @samp{@value{prefixsinglehop}toto@value{postfix}} | 2177 | and @samp{@value{prefixhop}toto@value{postfix}} |
| 1885 | might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} | 2178 | might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} |
| 1886 | file (given you're using default method @option{ssh}). | 2179 | file (given you're using default method @option{ssh}). |
| 1887 | 2180 | ||
| 1888 | If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to | 2181 | If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to |
| 1889 | @samp{@value{prefix}telnet@value{postfixsinglehop}}. | 2182 | @samp{@value{prefix}telnet@value{postfixhop}}. |
| 1890 | Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in | 2183 | Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in |
| 1891 | your @file{/etc/hosts} file, let's say | 2184 | your @file{/etc/hosts} file, let's say |
| 1892 | 2185 | ||
| 1893 | @example | 2186 | @example |
| 1894 | @value{prefixsinglehop}telnet@value{postfixsinglehop}127.0.0.1@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}192.168.0.1@value{postfix} | 2187 | @trampfnmhl{telnet,127.0.0.1,} @trampfnmhl{telnet,192.168.0.1,} |
| 1895 | @value{prefixsinglehop}telnet@value{postfixsinglehop}localhost@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia.danann.net@value{postfix} | 2188 | @trampfnmhl{telnet,localhost,} @trampfnmhl{telnet,melancholia.danann.net,} |
| 1896 | @value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia@value{postfix} | 2189 | @trampfnmhl{telnet,melancholia,} |
| 1897 | @end example | 2190 | @end example |
| 1898 | 2191 | ||
| 1899 | Now you can choose the desired machine, and you can continue to | 2192 | Now you can choose the desired machine, and you can continue to |
| 1900 | complete file names on that machine. | 2193 | complete file names on that machine. |
| 1901 | 2194 | ||
| 1902 | As filename completion needs to fetch the listing of files from the | ||
| 1903 | remote machine, this feature is sometimes fairly slow. As @value{tramp} | ||
| 1904 | does not yet cache the results of directory listing, there is no gain | ||
| 1905 | in performance the second time you complete filenames. | ||
| 1906 | |||
| 1907 | If the configuration files (@pxref{Customizing Completion}), which | 2195 | If the configuration files (@pxref{Customizing Completion}), which |
| 1908 | @value{tramp} uses for analysis of completion, offer user names, those user | 2196 | @value{tramp} uses for analysis of completion, offer user names, those user |
| 1909 | names will be taken into account as well. | 2197 | names will be taken into account as well. |
| 1910 | 2198 | ||
| 2199 | Remote machines, which have been visited in the past and kept | ||
| 2200 | persistently (@pxref{Connection caching}), will be offered too. | ||
| 1911 | 2201 | ||
| 1912 | @node Dired | 2202 | Once the remote machine identification is completed, it comes to |
| 1913 | @section Dired | 2203 | filename completion on the remote host. This works pretty much like |
| 1914 | @cindex dired | 2204 | for files on the local host, with the exception that minibuffer |
| 2205 | killing via a double-slash works only on the filename part, except | ||
| 2206 | that filename part starts with @file{//}. | ||
| 2207 | @ifinfo | ||
| 2208 | @xref{Minibuffer File, , , @value{emacsdir}}. | ||
| 2209 | @end ifinfo | ||
| 1915 | 2210 | ||
| 1916 | @value{tramp} works transparently with dired, enabling you to use this powerful | 2211 | @ifset emacs |
| 1917 | file management tool to manage files on any machine you have access to | 2212 | As example, @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin//etc} |
| 1918 | over the Internet. | 2213 | @key{TAB}} would result in |
| 2214 | @file{@trampfnmhl{telnet,melancholia,/etc}}, whereas | ||
| 2215 | @kbd{@trampfnmhl{telnet,melancholia,//etc} @key{TAB}} reduces the | ||
| 2216 | minibuffer contents to @file{/etc}. A triple-slash stands for the | ||
| 2217 | default behaviour, | ||
| 2218 | i.e. @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin///etc} | ||
| 2219 | @key{TAB}} expands directly to @file{/etc}. | ||
| 2220 | @end ifset | ||
| 1919 | 2221 | ||
| 1920 | If you need to browse a directory tree, Dired is a better choice, at | 2222 | @ifset xemacs |
| 1921 | present, than filename completion. Dired has its own cache mechanism | 2223 | As example, @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin//}} |
| 1922 | and will only fetch the directory listing once. | 2224 | would result in @file{@trampfnmhl{telnet,melancholia,/}}, whereas |
| 2225 | @kbd{@trampfnmhl{telnet,melancholia,//}} expands the minibuffer | ||
| 2226 | contents to @file{/}. | ||
| 2227 | @end ifset | ||
| 1923 | 2228 | ||
| 1924 | 2229 | ||
| 1925 | @node Compilation | 2230 | @node Remote processes |
| 1926 | @section Compile remote files | 2231 | @section Integration with other @value{emacsname} packages (@sc{experimental}). |
| 1927 | @cindex compile | 2232 | @cindex compile |
| 1928 | @cindex recompile | 2233 | @cindex recompile |
| 2234 | @cindex gud | ||
| 2235 | @cindex gdb | ||
| 2236 | @cindex perldb | ||
| 2237 | |||
| 2238 | @value{tramp} has an @sc{experimental} implementation for running | ||
| 2239 | processes on a remote host. This allows to exploit @value{emacsname} | ||
| 2240 | packages without modification for remote file names. It does not work | ||
| 2241 | for the @option{ftp} and @option{smb} methods. | ||
| 2242 | |||
| 2243 | Remote processes are started when a corresponding command is executed | ||
| 2244 | from a buffer belonging to a remote file or directory. Up to now, the | ||
| 2245 | packages @file{compile.el} (commands like @code{compile} and | ||
| 2246 | @code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}) have been | ||
| 2247 | integrated. Integration of further packages is planned, any help for | ||
| 2248 | this is welcome! | ||
| 2249 | |||
| 2250 | When your program is not found in the default search path | ||
| 2251 | @value{tramp} sets on the remote machine, you should either use an | ||
| 2252 | absolute path, or extend @code{tramp-remote-path} (see @ref{Remote | ||
| 2253 | Programs}): | ||
| 2254 | |||
| 2255 | @lisp | ||
| 2256 | (add-to-list 'tramp-remote-path "~/bin") | ||
| 2257 | (add-to-list 'tramp-remote-path "/appli/pub/bin") | ||
| 2258 | @end lisp | ||
| 2259 | |||
| 2260 | The environment for your program can be adapted by customizing | ||
| 2261 | @code{tramp-remote-process-environment}. This variable is a list of | ||
| 2262 | strings. It is structured like @code{process-environment}. Each | ||
| 2263 | element is a string of the form ENVVARNAME=VALUE. An entry | ||
| 2264 | ENVVARNAME= disables the corresponding environment variable, which | ||
| 2265 | might have been set in your init file like @file{~/.profile}. | ||
| 2266 | |||
| 2267 | @noindent | ||
| 2268 | Adding an entry can be performed via @code{add-to-list}: | ||
| 2269 | |||
| 2270 | @lisp | ||
| 2271 | (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") | ||
| 2272 | @end lisp | ||
| 1929 | 2273 | ||
| 1930 | @value{tramp} provides commands for compilation of files on remote | 2274 | Changing or removing an existing entry is not encouraged. The default |
| 1931 | machines. In order to get them loaded, you need to require | 2275 | values are chosen for proper @value{tramp} work. Nevertheless, if for |
| 1932 | @file{tramp-util.el}: | 2276 | example a paranoid system administrator disallows changing the |
| 2277 | @var{$HISTORY} environment variable, you can customize | ||
| 2278 | @code{tramp-remote-process-environment}, or you can apply the | ||
| 2279 | following code in your @file{.emacs}: | ||
| 1933 | 2280 | ||
| 1934 | @lisp | 2281 | @lisp |
| 1935 | (require 'tramp-util) | 2282 | (let ((process-environment tramp-remote-process-environment)) |
| 2283 | (setenv "HISTORY" nil) | ||
| 2284 | (setq tramp-remote-process-environment process-environment)) | ||
| 1936 | @end lisp | 2285 | @end lisp |
| 1937 | 2286 | ||
| 1938 | Afterwards, you can use the commands @code{tramp-compile} and | 2287 | If you use other @value{emacsname} packages which do not run |
| 1939 | @code{tramp-recompile} instead of @code{compile} and @code{recompile}, | 2288 | out-of-the-box on a remote host, please let us know. We will try to |
| 1940 | respectively; @inforef{Compilation, ,@value{emacsdir}}. This does not | 2289 | integrate them as well. @xref{Bug Reports}. |
| 1941 | work for the @option{ftp} and @option{smb} methods. | ||
| 1942 | 2290 | ||
| 1943 | The corresponding key bindings and menu entries calling these commands | ||
| 1944 | are redefined automatically for buffers associated with remote files. | ||
| 1945 | 2291 | ||
| 1946 | After finishing the compilation, you can use the usual commands like | 2292 | @subsection Running eshell on a remote host |
| 1947 | @code{previous-error}, @code{next-error} and @code{first-error} for | 2293 | @cindex eshell |
| 1948 | navigation in the @file{*Compilation*} buffer. | 2294 | |
| 2295 | @value{tramp} is integrated into @file{eshell.el}. That is, you can | ||
| 2296 | open an interactive shell on your remote host, and run commands there. | ||
| 2297 | After you have started @code{eshell}, you could perform commands like | ||
| 2298 | this: | ||
| 2299 | |||
| 2300 | @example | ||
| 2301 | @b{~ $} cd @trampfnmhl{sudo, , /etc} | ||
| 2302 | @b{@trampfn{sudo, root, host, /etc} $} hostname | ||
| 2303 | host | ||
| 2304 | @b{@trampfn{sudo, root, host, /etc} $} id | ||
| 2305 | uid=0(root) gid=0(root) groups=0(root) | ||
| 2306 | @b{@trampfn{sudo, root, host, /etc} $} find-file shadow | ||
| 2307 | #<buffer shadow> | ||
| 2308 | @b{@trampfn{sudo, root, host, /etc} $} | ||
| 2309 | @end example | ||
| 1949 | 2310 | ||
| 1950 | 2311 | ||
| 1951 | @node Bug Reports | 2312 | @node Bug Reports |
| @@ -1953,7 +2314,7 @@ navigation in the @file{*Compilation*} buffer. | |||
| 1953 | @cindex bug reports | 2314 | @cindex bug reports |
| 1954 | 2315 | ||
| 1955 | Bugs and problems with @value{tramp} are actively worked on by the | 2316 | Bugs and problems with @value{tramp} are actively worked on by the |
| 1956 | development team. Feature requests and suggestions are also more than | 2317 | development team. Feature requests and suggestions are also more than |
| 1957 | welcome. | 2318 | welcome. |
| 1958 | 2319 | ||
| 1959 | The @value{tramp} mailing list is a great place to get information on | 2320 | The @value{tramp} mailing list is a great place to get information on |
| @@ -1964,16 +2325,16 @@ non-subscribers can post but messages will be delayed, possibly up to | |||
| 1964 | your message. | 2325 | your message. |
| 1965 | 2326 | ||
| 1966 | The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to | 2327 | The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to |
| 1967 | this address go to all the subscribers. This is @emph{not} the address | 2328 | this address go to all the subscribers. This is @emph{not} the address |
| 1968 | to send subscription requests to. | 2329 | to send subscription requests to. |
| 1969 | 2330 | ||
| 1970 | Subscribing to the list is performed via | 2331 | Subscribing to the list is performed via |
| 1971 | @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, | 2332 | @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, |
| 1972 | the @value{tramp} Mail Subscription Page}. | 2333 | the @value{tramp} Mail Subscription Page}. |
| 1973 | 2334 | ||
| 1974 | To report a bug in @value{tramp}, you should execute @kbd{M-x tramp-bug}. This | 2335 | To report a bug in @value{tramp}, you should execute @kbd{M-x |
| 1975 | will automatically generate a buffer with the details of your system and | 2336 | tramp-bug}. This will automatically generate a buffer with the details |
| 1976 | @value{tramp} version. | 2337 | of your system and @value{tramp} version. |
| 1977 | 2338 | ||
| 1978 | When submitting a bug report, please try to describe in excruciating | 2339 | When submitting a bug report, please try to describe in excruciating |
| 1979 | detail the steps required to reproduce the problem, the setup of the | 2340 | detail the steps required to reproduce the problem, the setup of the |
| @@ -1982,8 +2343,20 @@ check that your problem is not described already in @xref{Frequently | |||
| 1982 | Asked Questions}. | 2343 | Asked Questions}. |
| 1983 | 2344 | ||
| 1984 | If you can identify a minimal test case that reproduces the problem, | 2345 | If you can identify a minimal test case that reproduces the problem, |
| 1985 | include that with your bug report. This will make it much easier for the | 2346 | include that with your bug report. This will make it much easier for |
| 1986 | development team to analyze and correct the problem. | 2347 | the development team to analyze and correct the problem. |
| 2348 | |||
| 2349 | Before reporting the bug, you should set the verbosity level to 6 | ||
| 2350 | (@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and | ||
| 2351 | repeat the bug. Then, include the contents of the @file{*tramp/foo*} | ||
| 2352 | and @file{*debug tramp/foo*} buffers in your bug report. A verbosity | ||
| 2353 | level greater than 6 will produce a very huge debug buffer, which is | ||
| 2354 | mostly not necessary for the analysis. | ||
| 2355 | |||
| 2356 | Please be aware that, with a verbosity level of 6 or greater, the | ||
| 2357 | contents of files and directories will be included in the debug | ||
| 2358 | buffer. Passwords you've typed will never be included there. | ||
| 2359 | |||
| 1987 | 2360 | ||
| 1988 | @node Frequently Asked Questions | 2361 | @node Frequently Asked Questions |
| 1989 | @chapter Frequently Asked Questions | 2362 | @chapter Frequently Asked Questions |
| @@ -2009,10 +2382,9 @@ There is also a Savannah project page. | |||
| 2009 | @item | 2382 | @item |
| 2010 | Which systems does it work on? | 2383 | Which systems does it work on? |
| 2011 | 2384 | ||
| 2012 | The package has been used successfully on GNU Emacs 20, GNU Emacs 21 | 2385 | The package has been used successfully on GNU Emacs 21, GNU Emacs 22 |
| 2013 | and GNU Emacs 22, as well as XEmacs 21. XEmacs 20 is more | 2386 | and XEmacs 21 (starting with 21.4). Gateway methods are supported for |
| 2014 | problematic, see the notes in @file{tramp.el}. I don't think anybody | 2387 | GNU Emacs 22 only. |
| 2015 | has really tried it on GNU Emacs 19. | ||
| 2016 | 2388 | ||
| 2017 | The package was intended to work on Unix, and it really expects a | 2389 | The package was intended to work on Unix, and it really expects a |
| 2018 | Unix-like system on the remote end (except the @option{smb} method), | 2390 | Unix-like system on the remote end (except the @option{smb} method), |
| @@ -2023,13 +2395,41 @@ There is some informations on @value{tramp} on NT at the following URL; | |||
| 2023 | many thanks to Joe Stoy for providing the information: | 2395 | many thanks to Joe Stoy for providing the information: |
| 2024 | @uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/} | 2396 | @uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/} |
| 2025 | 2397 | ||
| 2026 | @c The link is broken. I've contacted Tom for clarification. Michael. | 2398 | @c The link is broken. I've contacted Tom for clarification. Michael. |
| 2027 | @ignore | 2399 | @ignore |
| 2028 | The above mostly contains patches to old ssh versions; Tom Roche has a | 2400 | The above mostly contains patches to old ssh versions; Tom Roche has a |
| 2029 | Web page with instructions: | 2401 | Web page with instructions: |
| 2030 | @uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html} | 2402 | @uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html} |
| 2031 | @end ignore | 2403 | @end ignore |
| 2032 | 2404 | ||
| 2405 | @item | ||
| 2406 | How could I speed up @value{tramp}? | ||
| 2407 | |||
| 2408 | In the backstage, @value{tramp} needs a lot of operations on the | ||
| 2409 | remote host. The time for transferring data from and to the remote | ||
| 2410 | host as well as the time needed to perform the operations there count. | ||
| 2411 | In order to speed up @value{tramp}, one could either try to avoid some | ||
| 2412 | of the operations, or one could try to improve their performance. | ||
| 2413 | |||
| 2414 | Use an external transfer method, like @option{scpc}. | ||
| 2415 | |||
| 2416 | Use caching. This is already enabled by default. Information about | ||
| 2417 | the remote host as well as the remote files are cached for reuse. Th | ||
| 2418 | information about remote hosts is kept in the file specified in | ||
| 2419 | @code{tramp-persistency-file-name}. Keep this file. | ||
| 2420 | |||
| 2421 | Disable version control. If you access remote files which are not | ||
| 2422 | under version control, a lot of check operations can be avoided by | ||
| 2423 | disabling VC. This can be achieved by | ||
| 2424 | |||
| 2425 | @lisp | ||
| 2426 | (setq vc-handled-backends nil) | ||
| 2427 | @end lisp | ||
| 2428 | |||
| 2429 | Disable excessive traces. The default trace level of @value{tramp}, | ||
| 2430 | defined in the variable @code{tramp-verbose}, is 3. You should | ||
| 2431 | increase this level only temporarily, hunting bugs. | ||
| 2432 | |||
| 2033 | 2433 | ||
| 2034 | @item | 2434 | @item |
| 2035 | @value{tramp} does not connect to the remote host | 2435 | @value{tramp} does not connect to the remote host |
| @@ -2048,6 +2448,17 @@ contains unknown characters like escape sequences for coloring. This | |||
| 2048 | should be avoided on the remote side. @xref{Remote shell setup}. for | 2448 | should be avoided on the remote side. @xref{Remote shell setup}. for |
| 2049 | setting the regular expression detecting the prompt. | 2449 | setting the regular expression detecting the prompt. |
| 2050 | 2450 | ||
| 2451 | You can check your settings after an unsuccessful connection by | ||
| 2452 | switching to the @value{tramp} connection buffer @file{*tramp/foo*}, | ||
| 2453 | setting the cursor at the top of the buffer, and applying the expression | ||
| 2454 | |||
| 2455 | @example | ||
| 2456 | @kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))} | ||
| 2457 | @end example | ||
| 2458 | |||
| 2459 | If it fails, or the cursor is not moved at the end of the buffer, your | ||
| 2460 | prompt is not recognised correctly. | ||
| 2461 | |||
| 2051 | A special problem is the zsh, which uses left-hand side and right-hand | 2462 | A special problem is the zsh, which uses left-hand side and right-hand |
| 2052 | side prompts in parallel. Therefore, it is necessary to disable the | 2463 | side prompts in parallel. Therefore, it is necessary to disable the |
| 2053 | zsh line editor on the remote host. You shall add to @file{~/.zshrc} | 2464 | zsh line editor on the remote host. You shall add to @file{~/.zshrc} |
| @@ -2057,15 +2468,34 @@ the following command: | |||
| 2057 | [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' | 2468 | [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' |
| 2058 | @end example | 2469 | @end example |
| 2059 | 2470 | ||
| 2471 | |||
| 2060 | @item | 2472 | @item |
| 2061 | @value{tramp} doesn't transfer strings with more than 500 characters | 2473 | @value{tramp} doesn't transfer strings with more than 500 characters |
| 2062 | correctly | 2474 | correctly |
| 2063 | 2475 | ||
| 2064 | On some few systems, the implementation of @code{process-send-string} | 2476 | On some few systems, the implementation of @code{process-send-string} |
| 2065 | seems to be broken for longer strings. This case, you should | 2477 | seems to be broken for longer strings. It is reported for HP-UX, |
| 2066 | customize the variable @code{tramp-chunksize} to 500. For a | 2478 | FreeBSD and Tru64 Unix, for example. This case, you should customize |
| 2067 | description how to determine whether this is necessary see the | 2479 | the variable @code{tramp-chunksize} to 500. For a description how to |
| 2068 | documentation of @code{tramp-chunksize}. | 2480 | determine whether this is necessary see the documentation of |
| 2481 | @code{tramp-chunksize}. | ||
| 2482 | |||
| 2483 | Additionally, it will be useful to set @code{file-precious-flag} to | ||
| 2484 | @code{t} for @value{tramp} files. Then the file contents will be | ||
| 2485 | written into a temporary file first, which is checked for correct | ||
| 2486 | checksum. | ||
| 2487 | @ifinfo | ||
| 2488 | @pxref{Saving Buffers, , , elisp} | ||
| 2489 | @end ifinfo | ||
| 2490 | |||
| 2491 | @lisp | ||
| 2492 | (add-hook | ||
| 2493 | 'find-file-hooks | ||
| 2494 | '(lambda () | ||
| 2495 | (when (file-remote-p default-directory) | ||
| 2496 | (set (make-local-variable 'file-precious-flag) t)))) | ||
| 2497 | @end lisp | ||
| 2498 | |||
| 2069 | @end itemize | 2499 | @end itemize |
| 2070 | 2500 | ||
| 2071 | 2501 | ||
| @@ -2117,11 +2547,13 @@ remote host. | |||
| 2117 | " make tramp beep after writing a file." | 2547 | " make tramp beep after writing a file." |
| 2118 | (interactive) | 2548 | (interactive) |
| 2119 | (beep)) | 2549 | (beep)) |
| 2550 | |||
| 2120 | (defadvice tramp-handle-do-copy-or-rename-file | 2551 | (defadvice tramp-handle-do-copy-or-rename-file |
| 2121 | (after tramp-copy-beep-advice activate) | 2552 | (after tramp-copy-beep-advice activate) |
| 2122 | " make tramp beep after copying a file." | 2553 | " make tramp beep after copying a file." |
| 2123 | (interactive) | 2554 | (interactive) |
| 2124 | (beep)) | 2555 | (beep)) |
| 2556 | |||
| 2125 | (defadvice tramp-handle-insert-file-contents | 2557 | (defadvice tramp-handle-insert-file-contents |
| 2126 | (after tramp-copy-beep-advice activate) | 2558 | (after tramp-copy-beep-advice activate) |
| 2127 | " make tramp beep after copying a file." | 2559 | " make tramp beep after copying a file." |
| @@ -2130,6 +2562,60 @@ remote host. | |||
| 2130 | @end lisp | 2562 | @end lisp |
| 2131 | 2563 | ||
| 2132 | 2564 | ||
| 2565 | @ifset emacs | ||
| 2566 | @item | ||
| 2567 | I'ld like to see a host indication in the mode line when I'm remote | ||
| 2568 | |||
| 2569 | The following code has been tested with @value{emacsname} 22. You | ||
| 2570 | should put it into your @file{~/.emacs}: | ||
| 2571 | |||
| 2572 | @lisp | ||
| 2573 | (defconst my-mode-line-buffer-identification | ||
| 2574 | (list | ||
| 2575 | '(:eval | ||
| 2576 | (let ((host-name | ||
| 2577 | (if (file-remote-p default-directory) | ||
| 2578 | (tramp-file-name-host | ||
| 2579 | (tramp-dissect-file-name default-directory)) | ||
| 2580 | (system-name)))) | ||
| 2581 | (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name) | ||
| 2582 | (substring host-name 0 (match-beginning 1)) | ||
| 2583 | host-name))) | ||
| 2584 | ": %12b")) | ||
| 2585 | |||
| 2586 | (setq-default | ||
| 2587 | mode-line-buffer-identification | ||
| 2588 | my-mode-line-buffer-identification) | ||
| 2589 | |||
| 2590 | (add-hook | ||
| 2591 | 'dired-mode-hook | ||
| 2592 | '(lambda () | ||
| 2593 | (setq | ||
| 2594 | mode-line-buffer-identification | ||
| 2595 | my-mode-line-buffer-identification))) | ||
| 2596 | @end lisp | ||
| 2597 | @end ifset | ||
| 2598 | |||
| 2599 | |||
| 2600 | @ifset emacs | ||
| 2601 | @item | ||
| 2602 | My remote host does not understand default directory listing options | ||
| 2603 | |||
| 2604 | @value{emacsname} computes the @command{dired} options depending on | ||
| 2605 | the local host you are working. If your @command{ls} command on the | ||
| 2606 | remote host does not understand those options, you can change them | ||
| 2607 | like this: | ||
| 2608 | |||
| 2609 | @lisp | ||
| 2610 | (add-hook | ||
| 2611 | 'dired-before-readin-hook | ||
| 2612 | '(lambda () | ||
| 2613 | (when (file-remote-p default-directory) | ||
| 2614 | (setq dired-actual-switches "-al")))) | ||
| 2615 | @end lisp | ||
| 2616 | @end ifset | ||
| 2617 | |||
| 2618 | |||
| 2133 | @item | 2619 | @item |
| 2134 | There's this @file{~/.sh_history} file on the remote host which keeps | 2620 | There's this @file{~/.sh_history} file on the remote host which keeps |
| 2135 | growing and growing. What's that? | 2621 | growing and growing. What's that? |
| @@ -2152,6 +2638,218 @@ fi | |||
| 2152 | @end example | 2638 | @end example |
| 2153 | 2639 | ||
| 2154 | 2640 | ||
| 2641 | @item There are longish file names to type. How to shorten this? | ||
| 2642 | |||
| 2643 | Let's say you need regularly access to @file{@trampfn{ssh, news, | ||
| 2644 | news.my.domain, /opt/news/etc}}, which is boring to type again and | ||
| 2645 | again. The following approaches can be mixed: | ||
| 2646 | |||
| 2647 | @enumerate | ||
| 2648 | |||
| 2649 | @item Use default values for method and user name: | ||
| 2650 | |||
| 2651 | You can define default methods and user names for hosts, | ||
| 2652 | (@pxref{Default Method}, @pxref{Default User}): | ||
| 2653 | |||
| 2654 | @lisp | ||
| 2655 | (setq tramp-default-method "ssh" | ||
| 2656 | tramp-default-user "news") | ||
| 2657 | @end lisp | ||
| 2658 | |||
| 2659 | The file name left to type would be | ||
| 2660 | @kbd{C-x C-f @trampfnhl{news.my.domain, /opt/news/etc}}. | ||
| 2661 | |||
| 2662 | Note, that there are some useful settings already. Accessing your | ||
| 2663 | local host as @samp{root} user, is possible just by @kbd{C-x C-f | ||
| 2664 | @trampfnmhl{su,,}}. | ||
| 2665 | |||
| 2666 | @item Use configuration possibilities of your method: | ||
| 2667 | |||
| 2668 | Several connection methods (i.e. the programs used) offer powerful | ||
| 2669 | configuration possibilities (@pxref{Customizing Completion}). In the | ||
| 2670 | given case, this could be @file{~/.ssh/config}: | ||
| 2671 | |||
| 2672 | @example | ||
| 2673 | Host xy | ||
| 2674 | HostName news.my.domain | ||
| 2675 | User news | ||
| 2676 | @end example | ||
| 2677 | |||
| 2678 | The file name left to type would be @kbd{C-x C-f @trampfnmhl{ssh, xy, | ||
| 2679 | /opt/news/etc}}. Depending on files in your directories, it is even | ||
| 2680 | possible to complete the hostname with @kbd{C-x C-f | ||
| 2681 | @value{prefix}ssh@value{postfixhop}x @key{TAB}}. | ||
| 2682 | |||
| 2683 | @item Use environment variables: | ||
| 2684 | |||
| 2685 | File names typed in the minibuffer can be expanded by environment | ||
| 2686 | variables. You can set them outside @value{emacsname}, or even with | ||
| 2687 | Lisp: | ||
| 2688 | |||
| 2689 | @lisp | ||
| 2690 | (setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}") | ||
| 2691 | @end lisp | ||
| 2692 | |||
| 2693 | Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you | ||
| 2694 | are. The disadvantage is, that you cannot edit the file name, because | ||
| 2695 | environment variables are not expanded during editing in the | ||
| 2696 | minibuffer. | ||
| 2697 | |||
| 2698 | @item Define own keys: | ||
| 2699 | |||
| 2700 | You can define your own key sequences in @value{emacsname}, which can | ||
| 2701 | be used instead of @kbd{C-x C-f}: | ||
| 2702 | |||
| 2703 | @lisp | ||
| 2704 | (global-set-key | ||
| 2705 | [(control x) (control y)] | ||
| 2706 | (lambda () | ||
| 2707 | (interactive) | ||
| 2708 | (find-file | ||
| 2709 | (read-file-name | ||
| 2710 | "Find Tramp file: " | ||
| 2711 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))) | ||
| 2712 | @end lisp | ||
| 2713 | |||
| 2714 | Simply typing @kbd{C-x C-y} would initialize the minibuffer for | ||
| 2715 | editing with your beloved file name. | ||
| 2716 | |||
| 2717 | See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the | ||
| 2718 | Emacs Wiki} for a more comprehensive example. | ||
| 2719 | |||
| 2720 | @item Define own abbreviation (1): | ||
| 2721 | |||
| 2722 | It is possible to define an own abbreviation list for expanding file | ||
| 2723 | names: | ||
| 2724 | |||
| 2725 | @lisp | ||
| 2726 | (add-to-list | ||
| 2727 | 'directory-abbrev-alist | ||
| 2728 | '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) | ||
| 2729 | @end lisp | ||
| 2730 | |||
| 2731 | This shortens the file openening command to @kbd{C-x C-f /xy | ||
| 2732 | @key{RET}}. The disadvantage is, again, that you cannot edit the file | ||
| 2733 | name, because the expansion happens after entering the file name only. | ||
| 2734 | |||
| 2735 | @item Define own abbreviation (2): | ||
| 2736 | |||
| 2737 | The @code{abbrev-mode} gives more flexibility for editing the | ||
| 2738 | minibuffer: | ||
| 2739 | |||
| 2740 | @lisp | ||
| 2741 | (define-abbrev-table 'my-tramp-abbrev-table | ||
| 2742 | '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))) | ||
| 2743 | |||
| 2744 | (add-hook | ||
| 2745 | 'minibuffer-setup-hook | ||
| 2746 | '(lambda () | ||
| 2747 | (abbrev-mode 1) | ||
| 2748 | (setq local-abbrev-table my-tramp-abbrev-table))) | ||
| 2749 | |||
| 2750 | (defadvice minibuffer-complete | ||
| 2751 | (before my-minibuffer-complete activate) | ||
| 2752 | (expand-abbrev)) | ||
| 2753 | |||
| 2754 | ;; If you use partial-completion-mode | ||
| 2755 | (defadvice PC-do-completion | ||
| 2756 | (before my-PC-do-completion activate) | ||
| 2757 | (expand-abbrev)) | ||
| 2758 | @end lisp | ||
| 2759 | |||
| 2760 | After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is | ||
| 2761 | expanded, and you can continue editing. | ||
| 2762 | |||
| 2763 | @item Use bookmarks: | ||
| 2764 | |||
| 2765 | Bookmarks can be used to visit Tramp files or directories. | ||
| 2766 | @ifinfo | ||
| 2767 | @pxref{Bookmarks, , , @value{emacsdir}} | ||
| 2768 | @end ifinfo | ||
| 2769 | |||
| 2770 | When you have opened @file{@trampfn{ssh, news, news.my.domain, | ||
| 2771 | /opt/news/etc/}}, you should save the bookmark via | ||
| 2772 | @ifset emacs | ||
| 2773 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}. | ||
| 2774 | @end ifset | ||
| 2775 | @ifset xemacs | ||
| 2776 | @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}. | ||
| 2777 | @end ifset | ||
| 2778 | |||
| 2779 | Later on, you can always navigate to that bookmark via | ||
| 2780 | @ifset emacs | ||
| 2781 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}. | ||
| 2782 | @end ifset | ||
| 2783 | @ifset xemacs | ||
| 2784 | @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}. | ||
| 2785 | @end ifset | ||
| 2786 | |||
| 2787 | @item Use recent files: | ||
| 2788 | |||
| 2789 | @ifset emacs | ||
| 2790 | @file{recentf} | ||
| 2791 | @end ifset | ||
| 2792 | @ifset xemacs | ||
| 2793 | @file{recent-files} | ||
| 2794 | @end ifset | ||
| 2795 | remembers visited places. | ||
| 2796 | @ifinfo | ||
| 2797 | @ifset emacs | ||
| 2798 | @pxref{File Conveniences, , , @value{emacsdir}} | ||
| 2799 | @end ifset | ||
| 2800 | @ifset xemacs | ||
| 2801 | @pxref{recent-files, , , edit-utils} | ||
| 2802 | @end ifset | ||
| 2803 | @end ifinfo | ||
| 2804 | |||
| 2805 | You could keep remote file names in the recent list without checking | ||
| 2806 | their readability through a remote access: | ||
| 2807 | |||
| 2808 | @lisp | ||
| 2809 | @ifset emacs | ||
| 2810 | (require 'recentf) | ||
| 2811 | (add-to-list 'recentf-keep 'file-remote-p) | ||
| 2812 | (recentf-mode 1) | ||
| 2813 | @end ifset | ||
| 2814 | @ifset xemacs | ||
| 2815 | (recent-files-initialize) | ||
| 2816 | (add-hook | ||
| 2817 | 'find-file-hooks | ||
| 2818 | (lambda () | ||
| 2819 | (when (file-remote-p (buffer-file-name)) | ||
| 2820 | (recent-files-make-permanent))) | ||
| 2821 | 'append) | ||
| 2822 | @end ifset | ||
| 2823 | @end lisp | ||
| 2824 | |||
| 2825 | The list of files opened recently is reachable via | ||
| 2826 | @ifset emacs | ||
| 2827 | @kbd{@key{menu-bar} @key{file} @key{Open Recent}}. | ||
| 2828 | @end ifset | ||
| 2829 | @ifset xemacs | ||
| 2830 | @kbd{@key{menu-bar} @key{Recent Files}}. | ||
| 2831 | @end ifset | ||
| 2832 | |||
| 2833 | @ifset emacs | ||
| 2834 | @item Use filecache: | ||
| 2835 | |||
| 2836 | @file{filecache} remembers visited places. Add the directory into | ||
| 2837 | the cache: | ||
| 2838 | |||
| 2839 | @lisp | ||
| 2840 | (eval-after-load "filecache" | ||
| 2841 | '(file-cache-add-directory | ||
| 2842 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) | ||
| 2843 | @end lisp | ||
| 2844 | |||
| 2845 | Whenever you want to load a file, you can enter @kbd{C-x C-f | ||
| 2846 | C-@key{TAB}} in the minibuffer. The completion is done for the given | ||
| 2847 | directory. | ||
| 2848 | @end ifset | ||
| 2849 | |||
| 2850 | @end enumerate | ||
| 2851 | |||
| 2852 | |||
| 2155 | @item | 2853 | @item |
| 2156 | How can I disable @value{tramp}? | 2854 | How can I disable @value{tramp}? |
| 2157 | 2855 | ||
| @@ -2180,12 +2878,12 @@ This resets also the @value{ftppackagename} plugins. | |||
| 2180 | @cindex Version Control | 2878 | @cindex Version Control |
| 2181 | 2879 | ||
| 2182 | Unlike @value{ftppackagename}, @value{tramp} has full shell access to the | 2880 | Unlike @value{ftppackagename}, @value{tramp} has full shell access to the |
| 2183 | remote machine. This makes it possible to provide version control for | 2881 | remote machine. This makes it possible to provide version control for |
| 2184 | files accessed under @value{tramp}. | 2882 | files accessed under @value{tramp}. |
| 2185 | 2883 | ||
| 2186 | The actual version control binaries must be installed on the remote | 2884 | The actual version control binaries must be installed on the remote |
| 2187 | machine, accessible in the directories specified in | 2885 | machine, accessible in the directories specified in |
| 2188 | @var{tramp-remote-path}. | 2886 | @code{tramp-remote-path}. |
| 2189 | 2887 | ||
| 2190 | This transparent integration with the version control systems is one of | 2888 | This transparent integration with the version control systems is one of |
| 2191 | the most valuable features provided by @value{tramp}, but it is far from perfect. | 2889 | the most valuable features provided by @value{tramp}, but it is far from perfect. |
| @@ -2204,7 +2902,7 @@ Work is ongoing to improve the transparency of the system. | |||
| 2204 | @section Determining if a file is under version control | 2902 | @section Determining if a file is under version control |
| 2205 | 2903 | ||
| 2206 | The VC package uses the existence of on-disk revision control master | 2904 | The VC package uses the existence of on-disk revision control master |
| 2207 | files to determine if a given file is under revision control. These file | 2905 | files to determine if a given file is under revision control. These file |
| 2208 | tests happen on the remote machine through the standard @value{tramp} mechanisms. | 2906 | tests happen on the remote machine through the standard @value{tramp} mechanisms. |
| 2209 | 2907 | ||
| 2210 | 2908 | ||
| @@ -2212,7 +2910,7 @@ tests happen on the remote machine through the standard @value{tramp} mechanisms | |||
| 2212 | @section Executing the version control commands on the remote machine | 2910 | @section Executing the version control commands on the remote machine |
| 2213 | 2911 | ||
| 2214 | There are no hooks provided by VC to allow intercepting of the version | 2912 | There are no hooks provided by VC to allow intercepting of the version |
| 2215 | control command execution. The calls occur through the | 2913 | control command execution. The calls occur through the |
| 2216 | @code{call-process} mechanism, a function that is somewhat more | 2914 | @code{call-process} mechanism, a function that is somewhat more |
| 2217 | efficient than the @code{shell-command} function but that does not | 2915 | efficient than the @code{shell-command} function but that does not |
| 2218 | provide hooks for remote execution of commands. | 2916 | provide hooks for remote execution of commands. |
| @@ -2239,7 +2937,7 @@ workfile and the version control master. | |||
| 2239 | 2937 | ||
| 2240 | This requires that a shell command be executed remotely, a process that | 2938 | This requires that a shell command be executed remotely, a process that |
| 2241 | is notably heavier-weight than the mtime comparison used for local | 2939 | is notably heavier-weight than the mtime comparison used for local |
| 2242 | files. Unfortunately, unless a portable solution to the issue is found, | 2940 | files. Unfortunately, unless a portable solution to the issue is found, |
| 2243 | this will remain the cost of remote version control. | 2941 | this will remain the cost of remote version control. |
| 2244 | 2942 | ||
| 2245 | 2943 | ||
| @@ -2247,7 +2945,7 @@ this will remain the cost of remote version control. | |||
| 2247 | @section Bringing the workfile out of the repository | 2945 | @section Bringing the workfile out of the repository |
| 2248 | 2946 | ||
| 2249 | VC will, by default, check for remote files and refuse to act on them | 2947 | VC will, by default, check for remote files and refuse to act on them |
| 2250 | when checking out files from the repository. To work around this | 2948 | when checking out files from the repository. To work around this |
| 2251 | problem, the function @code{vc-checkout} knows about @value{tramp} files and | 2949 | problem, the function @code{vc-checkout} knows about @value{tramp} files and |
| 2252 | allows version control to occur. | 2950 | allows version control to occur. |
| 2253 | 2951 | ||
| @@ -2266,14 +2964,14 @@ Minor implementation details, &c. | |||
| 2266 | @node Remote File Ownership | 2964 | @node Remote File Ownership |
| 2267 | @subsection How VC determines who owns a workfile | 2965 | @subsection How VC determines who owns a workfile |
| 2268 | 2966 | ||
| 2269 | @value{emacsname} provides the @code{user-full-name} function to | 2967 | @value{emacsname} provides the @code{user-login-name} function to |
| 2270 | return the login name of the current user as well as mapping from | 2968 | return the login name of the current user as well as mapping from |
| 2271 | arbitrary user id values back to login names. The VC code uses this | 2969 | arbitrary user id values back to login names. The VC code uses this |
| 2272 | functionality to map from the uid of the owner of a workfile to the | 2970 | functionality to map from the uid of the owner of a workfile to the |
| 2273 | login name in some circumstances. | 2971 | login name in some circumstances. |
| 2274 | 2972 | ||
| 2275 | This will not, for obvious reasons, work if the remote system has a | 2973 | This will not, for obvious reasons, work if the remote system has a |
| 2276 | different set of logins. As such, it is necessary to delegate to the | 2974 | different set of logins. As such, it is necessary to delegate to the |
| 2277 | remote machine the job of determining the login name associated with a | 2975 | remote machine the job of determining the login name associated with a |
| 2278 | uid. | 2976 | uid. |
| 2279 | 2977 | ||
| @@ -2282,7 +2980,7 @@ as @code{NIS}, @code{NIS+} and @code{NetInfo}, there is no simple, | |||
| 2282 | reliable and portable method for performing this mapping. | 2980 | reliable and portable method for performing this mapping. |
| 2283 | 2981 | ||
| 2284 | Thankfully, the only place in the VC code that depends on the mapping of | 2982 | Thankfully, the only place in the VC code that depends on the mapping of |
| 2285 | a uid to a login name is the @code{vc-file-owner} function. This returns | 2983 | a uid to a login name is the @code{vc-file-owner} function. This returns |
| 2286 | the login of the owner of the file as a string. | 2984 | the login of the owner of the file as a string. |
| 2287 | 2985 | ||
| 2288 | This function has been advised to use the output of @command{ls} on the | 2986 | This function has been advised to use the output of @command{ls} on the |
| @@ -2304,7 +3002,7 @@ executing a process and parsing its output each time the information is | |||
| 2304 | needed. | 3002 | needed. |
| 2305 | 3003 | ||
| 2306 | Unfortunately, life is not quite so easy when remote version control | 3004 | Unfortunately, life is not quite so easy when remote version control |
| 2307 | comes into the picture. Each remote machine may have a different version | 3005 | comes into the picture. Each remote machine may have a different version |
| 2308 | of the version control tools and, while this is painful, we need to | 3006 | of the version control tools and, while this is painful, we need to |
| 2309 | ensure that unavailable features are not used remotely. | 3007 | ensure that unavailable features are not used remotely. |
| 2310 | 3008 | ||
| @@ -2313,9 +3011,9 @@ approach of making the release values of the revision control tools | |||
| 2313 | local to each @value{tramp} buffer, forcing VC to determine these values | 3011 | local to each @value{tramp} buffer, forcing VC to determine these values |
| 2314 | again each time a new file is visited. | 3012 | again each time a new file is visited. |
| 2315 | 3013 | ||
| 2316 | This has, quite obviously, some performance implications. Thankfully, | 3014 | This has, quite obviously, some performance implications. Thankfully, |
| 2317 | most of the common operations performed by VC do not actually require | 3015 | most of the common operations performed by VC do not actually require |
| 2318 | that the remote version be known. This makes the problem far less | 3016 | that the remote version be known. This makes the problem far less |
| 2319 | apparent. | 3017 | apparent. |
| 2320 | 3018 | ||
| 2321 | Eventually these values will be captured by @value{tramp} on a system by | 3019 | Eventually these values will be captured by @value{tramp} on a system by |
| @@ -2334,11 +3032,11 @@ system basis and the results cached to improve performance. | |||
| 2334 | @section Breaking a localname into its components. | 3032 | @section Breaking a localname into its components. |
| 2335 | 3033 | ||
| 2336 | @value{tramp} file names are somewhat different, obviously, to ordinary file | 3034 | @value{tramp} file names are somewhat different, obviously, to ordinary file |
| 2337 | names. As such, the lisp functions @code{file-name-directory} and | 3035 | names. As such, the lisp functions @code{file-name-directory} and |
| 2338 | @code{file-name-nondirectory} are overridden within the @value{tramp} | 3036 | @code{file-name-nondirectory} are overridden within the @value{tramp} |
| 2339 | package. | 3037 | package. |
| 2340 | 3038 | ||
| 2341 | Their replacements are reasonably simplistic in their approach. They | 3039 | Their replacements are reasonably simplistic in their approach. They |
| 2342 | dissect the filename, call the original handler on the localname and | 3040 | dissect the filename, call the original handler on the localname and |
| 2343 | then rebuild the @value{tramp} file name with the result. | 3041 | then rebuild the @value{tramp} file name with the result. |
| 2344 | 3042 | ||
| @@ -2346,6 +3044,77 @@ This allows the platform specific hacks in the original handlers to take | |||
| 2346 | effect while preserving the @value{tramp} file name information. | 3044 | effect while preserving the @value{tramp} file name information. |
| 2347 | 3045 | ||
| 2348 | 3046 | ||
| 3047 | @node Traces and Profiles | ||
| 3048 | @chapter How to Customize Traces | ||
| 3049 | |||
| 3050 | All @value{tramp} messages are raised with a verbosity level. The | ||
| 3051 | verbosity level can be any number between 0 and 10. Only messages with | ||
| 3052 | a verbosity level less than or equal to @code{tramp-verbose} are | ||
| 3053 | displayed. | ||
| 3054 | |||
| 3055 | The verbosity levels are | ||
| 3056 | |||
| 3057 | @w{ 0} silent (no @value{tramp} messages at all) | ||
| 3058 | @*@indent @w{ 1} errors | ||
| 3059 | @*@indent @w{ 2} warnings | ||
| 3060 | @*@indent @w{ 3} connection to remote hosts (default verbosity) | ||
| 3061 | @*@indent @w{ 4} activities | ||
| 3062 | @*@indent @w{ 5} internal | ||
| 3063 | @*@indent @w{ 6} sent and received strings | ||
| 3064 | @*@indent @w{ 7} file caching | ||
| 3065 | @*@indent @w{ 8} connection properties | ||
| 3066 | @*@indent @w{10} traces (huge) | ||
| 3067 | |||
| 3068 | When @code{tramp-verbose} is greater than or equal to 4, the messages | ||
| 3069 | are also written into a @value{tramp} debug buffer. This debug buffer | ||
| 3070 | is useful for analysing problems; sending a @value{tramp} bug report | ||
| 3071 | should be done with @code{tramp-verbose} set to a verbosity level of at | ||
| 3072 | least 6 (@pxref{Bug Reports}). | ||
| 3073 | |||
| 3074 | The debug buffer is in | ||
| 3075 | @ifinfo | ||
| 3076 | @ref{Outline Mode, , , @value{emacsdir}}. | ||
| 3077 | @end ifinfo | ||
| 3078 | @ifnotinfo | ||
| 3079 | Outline Mode. | ||
| 3080 | @end ifnotinfo | ||
| 3081 | That means, you can change the level of messages to be viewed. If you | ||
| 3082 | want, for example, see only messages up to verbosity level 5, you must | ||
| 3083 | enter @kbd{C-u 6 C-c C-q}. | ||
| 3084 | @ifinfo | ||
| 3085 | Other keys for navigating are described in | ||
| 3086 | @ref{Outline Visibility, , , @value{emacsdir}}. | ||
| 3087 | @end ifinfo | ||
| 3088 | |||
| 3089 | @value{tramp} errors are handled internally in order to raise the | ||
| 3090 | verbosity level 1 messages. When you want to get a Lisp backtrace in | ||
| 3091 | case of an error, you need to set both | ||
| 3092 | |||
| 3093 | @lisp | ||
| 3094 | (setq debug-on-error t | ||
| 3095 | debug-on-signal t) | ||
| 3096 | @end lisp | ||
| 3097 | |||
| 3098 | Sometimes, it might be even necessary to step through @value{tramp} | ||
| 3099 | function call traces. Such traces are enabled by the following code: | ||
| 3100 | |||
| 3101 | @lisp | ||
| 3102 | (require 'tramp) | ||
| 3103 | (require 'trace) | ||
| 3104 | (mapcar 'trace-function-background | ||
| 3105 | (mapcar 'intern | ||
| 3106 | (all-completions "tramp-" obarray 'functionp))) | ||
| 3107 | (untrace-function 'tramp-read-passwd) | ||
| 3108 | (untrace-function 'tramp-gw-basic-authentication) | ||
| 3109 | @end lisp | ||
| 3110 | |||
| 3111 | The function call traces are inserted in the buffer | ||
| 3112 | @file{*trace-output*}. @code{tramp-read-passwd} and | ||
| 3113 | @code{tramp-gw-basic-authentication} shall be disabled when the | ||
| 3114 | function call traces are added to @value{tramp}, because both | ||
| 3115 | functions return password strings, which should not be distributed. | ||
| 3116 | |||
| 3117 | |||
| 2349 | @node Issues | 3118 | @node Issues |
| 2350 | @chapter Debatable Issues and What Was Decided | 3119 | @chapter Debatable Issues and What Was Decided |
| 2351 | 3120 | ||
| @@ -2368,14 +3137,6 @@ printed and deleted. | |||
| 2368 | But I have decided that this is too fragile to reliably work, so on some | 3137 | But I have decided that this is too fragile to reliably work, so on some |
| 2369 | systems you'll have to do without the uuencode methods. | 3138 | systems you'll have to do without the uuencode methods. |
| 2370 | 3139 | ||
| 2371 | @item @value{tramp} does not work on XEmacs 20. | ||
| 2372 | |||
| 2373 | This is because it requires the macro @code{with-timeout} which does not | ||
| 2374 | appear to exist in XEmacs 20. I'm somewhat reluctant to add an | ||
| 2375 | emulation macro to @value{tramp}, but if somebody who uses XEmacs 20 steps | ||
| 2376 | forward and wishes to implement and test it, please contact me or the | ||
| 2377 | mailing list. | ||
| 2378 | |||
| 2379 | @item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs. | 3140 | @item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs. |
| 2380 | 3141 | ||
| 2381 | The GNU Emacs maintainers wish to use a unified filename syntax for | 3142 | The GNU Emacs maintainers wish to use a unified filename syntax for |
| @@ -2402,10 +3163,10 @@ The autoload of the @value{emacsname} @value{tramp} package must be | |||
| 2402 | disabled. This can be achieved by setting file permissions @code{000} | 3163 | disabled. This can be achieved by setting file permissions @code{000} |
| 2403 | to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}. | 3164 | to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}. |
| 2404 | 3165 | ||
| 2405 | In case of unified filenames, all @value{emacsname} download sites | 3166 | In case of unified filenames, all @value{emacsname} download sites are |
| 2406 | are added to @code{tramp-default-method-alist} with default method | 3167 | added to @code{tramp-default-method-alist} with default method |
| 2407 | @option{ftp} @xref{Default Method}. These settings shouldn't be touched | 3168 | @option{ftp} @xref{Default Method}. These settings shouldn't be |
| 2408 | for proper working of the @value{emacsname} package system. | 3169 | touched for proper working of the @value{emacsname} package system. |
| 2409 | 3170 | ||
| 2410 | The syntax for unified filenames is described in the @value{tramp} manual | 3171 | The syntax for unified filenames is described in the @value{tramp} manual |
| 2411 | for @value{emacsothername}. | 3172 | for @value{emacsothername}. |
| @@ -2430,7 +3191,6 @@ for @value{emacsothername}. | |||
| 2430 | @c shells. | 3191 | @c shells. |
| 2431 | @c * Explain how tramp.el works in principle: open a shell on a remote | 3192 | @c * Explain how tramp.el works in principle: open a shell on a remote |
| 2432 | @c host and then send commands to it. | 3193 | @c host and then send commands to it. |
| 2433 | @c * Mention that bookmarks are a cool feature to go along with Tramp. | ||
| 2434 | @c * Make terminology "inline" vs "out-of-band" consistent. | 3194 | @c * Make terminology "inline" vs "out-of-band" consistent. |
| 2435 | @c It seems that "external" is also used instead of "out-of-band". | 3195 | @c It seems that "external" is also used instead of "out-of-band". |
| 2436 | 3196 | ||
diff --git a/man/trampver.texi b/man/trampver.texi index 6c770dc8ad1..6d97869d115 100644 --- a/man/trampver.texi +++ b/man/trampver.texi | |||
| @@ -1,27 +1,26 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c texi/trampver.texi. Generated from trampver.texi.in by configure. | 2 | @c texi/trampver.texi. Generated from trampver.texi.in by configure. |
| 3 | 3 | ||
| 4 | @c This is part of the Emacs manual. | ||
| 5 | @c Copyright (C) 2003, 2004, 2005, 2006, 2007 | ||
| 6 | @c Free Software Foundation, Inc. | ||
| 7 | @c See file emacs.texi for copying conditions. | ||
| 8 | |||
| 9 | @c In the Tramp CVS, the version number is auto-frobbed from | 4 | @c In the Tramp CVS, the version number is auto-frobbed from |
| 10 | @c configure.ac, so you should edit that file and run | 5 | @c configure.ac, so you should edit that file and run |
| 11 | @c "autoconf && ./configure" to change the version number. | 6 | @c "autoconf && ./configure" to change the version number. |
| 12 | @set trampver 2.0.56 | 7 | @set trampver 2.1.10-pre |
| 13 | 8 | ||
| 14 | @c Other flags from configuration | 9 | @c Other flags from configuration |
| 15 | @set prefix /usr/local | 10 | @set instprefix /usr/local |
| 16 | @set lispdir /usr/local/share/emacs/site-lisp | 11 | @set lispdir /usr/local/share/emacs/site-lisp |
| 17 | @set infodir /usr/local/share/info | 12 | @set infodir /usr/local/info |
| 18 | 13 | ||
| 19 | @c Formatting of the tramp program name consistent. | 14 | @c Formatting of the tramp program name consistent. |
| 20 | @set tramp @sc{tramp} | 15 | @set tramp @sc{tramp} |
| 21 | 16 | ||
| 17 | @c Whether or not describe gateway methods. | ||
| 18 | @ifclear noemacsgw | ||
| 19 | @set emacsgw | ||
| 20 | @end ifclear | ||
| 21 | |||
| 22 | @c Some flags which make the text independent on the (X)Emacs flavor. | 22 | @c Some flags which make the text independent on the (X)Emacs flavor. |
| 23 | @c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs". | 23 | @c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs". |
| 24 | |||
| 25 | @ifclear emacs | 24 | @ifclear emacs |
| 26 | @ifclear xemacs | 25 | @ifclear xemacs |
| 27 | @set emacs | 26 | @set emacs |
| @@ -34,10 +33,9 @@ | |||
| 34 | @set emacsdir emacs | 33 | @set emacsdir emacs |
| 35 | @set ftppackagename Ange-FTP | 34 | @set ftppackagename Ange-FTP |
| 36 | @set prefix / | 35 | @set prefix / |
| 37 | @set prefixsinglehop | 36 | @set prefixhop |
| 38 | @set postfix : | 37 | @set postfix : |
| 39 | @set postfixsinglehop : | 38 | @set postfixhop : |
| 40 | @set postfixmultihop : | ||
| 41 | @set emacsothername XEmacs | 39 | @set emacsothername XEmacs |
| 42 | @set emacsotherdir xemacs | 40 | @set emacsotherdir xemacs |
| 43 | @set emacsotherfilename tramp-xemacs.html | 41 | @set emacsotherfilename tramp-xemacs.html |
| @@ -50,10 +48,9 @@ | |||
| 50 | @set emacsdir xemacs | 48 | @set emacsdir xemacs |
| 51 | @set ftppackagename EFS | 49 | @set ftppackagename EFS |
| 52 | @set prefix /[ | 50 | @set prefix /[ |
| 53 | @set prefixsinglehop [ | 51 | @set prefixhop [ |
| 54 | @set postfix ] | 52 | @set postfix ] |
| 55 | @set postfixsinglehop / | 53 | @set postfixhop / |
| 56 | @set postfixmultihop : | ||
| 57 | @set emacsothername GNU Emacs | 54 | @set emacsothername GNU Emacs |
| 58 | @set emacsotherdir emacs | 55 | @set emacsotherdir emacs |
| 59 | @set emacsotherfilename tramp-emacs.html | 56 | @set emacsotherfilename tramp-emacs.html |