* tramp.texi (Top, Configuration): Insert section `Predefined
[bpt/emacs.git] / doc / misc / tramp.texi
index 4a3e0eb..1121a45 100644 (file)
@@ -214,6 +214,8 @@ Configuring @value{tramp} for use
 * Customizing Completion::      Selecting config files for user/host name completion.
 * Password handling::           Reusing passwords for several connections.
 * Connection caching::          Reusing connection related information.
+* Predefined connection information::
+                                Setting own connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Android shell setup::         Android shell setup hints.
@@ -542,6 +544,8 @@ Method}.
 * Customizing Completion::      Selecting config files for user/host name completion.
 * Password handling::           Reusing passwords for several connections.
 * Connection caching::          Reusing connection related information.
+* Predefined connection information::
+                                Setting own connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Android shell setup::         Android shell setup hints.
@@ -1727,6 +1731,35 @@ connection related information for this host, and opens the
 connection again.
 
 
+@node Predefined connection information
+@section Setting own connection related information
+
+Sometimes, @var{tramp} is not able to detect correct connection
+related information.  In such cases, you could tell @var{tramp} which
+value it has to take.  Since this could result in errors, it has to be
+used with care.
+
+@vindex tramp-connection-properties
+Such settings can be performed via the list
+@code{tramp-connection-properties}.  An entry in this list has the
+form @code{(@var{regexp} @var{property} @var{value})}.  @var{regexp}
+matches remote file names for which a property shall be predefined.
+It can be @code{nil}.  @var{property} is a string, and @var{value} the
+corresponding value.  @var{property} could be any property found in
+the file @code{tramp-persistency-file-name}.
+
+A special property is @code{"busybox"}.  This must be set, if the
+remote host runs a very restricted busybox as shell, which closes the
+connection at will.  Since there is no reliable test for this,
+@var{tramp} must be indicated this way.  Example:
+
+@lisp
+(add-to-list 'tramp-connection-properties
+             (list (regexp-quote "@trampfn{ssh, user, randomhost.your.domain,}")
+                   "busybox" t))
+@end lisp
+
+
 @node Remote Programs
 @section How @value{tramp} finds and uses programs on the remote machine
 
@@ -1874,7 +1907,7 @@ key.
 
 @var{tramp-password-prompt-regexp} handles the detection of such
 requests for English environments.  When you use another localization
-of your (local or remote) host, you might need to adapt this. Example:
+of your (local or remote) host, you might need to adapt this.  Example:
 
 @lisp
 (setq
@@ -2048,7 +2081,8 @@ You can instruct @value{tramp} by this form:
 @end lisp
 
 @noindent
-with @samp{192.168.0.26} being the IP address of your Android device.
+with @samp{192.168.0.26} being the IP address of your Android device
+(@pxref{Predefined connection information}).
 
 The user settings for the @code{$PATH} environment variable must be
 preserved.  It has also been reported, that the commands in
@@ -2406,13 +2440,18 @@ using the @option{ssh} method to transfer files, and edit
 @file{.emacs} in my home directory I would specify the filename
 @file{@trampfn{ssh, daniel, melancholia, .emacs}}.
 
+@ifset emacs
+A remote filename containing a host name only, which is equal to a
+method name, is not allowed.  If such a host name is used, it must
+always be preceded by an explicit method name, like
+@file{@value{prefix}ssh@value{postfixhop}ssh@value{postfix}}.
+@end ifset
+
 Finally, for some methods it is possible to specify a different port
 number than the default one, given by the method.  This is specified
 by adding @file{#<port>} to the host name, like in @file{@trampfn{ssh,
 daniel, melancholia#42, .emacs}}.
 
-Note that @value{tramp} supports only filenames encoded in unibyte.
-
 
 @node Alternative Syntax
 @section URL-like filename syntax
@@ -3118,6 +3157,45 @@ Host *
 @end example
 
 
+@item
+@value{tramp} does not use my @command{ssh} @code{ControlPath}
+
+Your @code{ControlPath} setting will be overwritten by @command{ssh}
+sessions initiated by @value{tramp}.  This is because a master
+session, initiated outside @value{emacsname}, could be closed, which
+would stall all other @command{ssh} sessions for that host inside
+@value{emacsname}.
+
+Consequently, if you connect to a remote host via @value{tramp}, you
+might be prompted for a password again, even if you have established
+already an @command{ssh} connection to that host.  Further
+@value{tramp} connections to that host, for example in order to run a
+process on that host, will reuse that initial @command{ssh}
+connection.
+
+If your @command{ssh} version supports the @code{ControlPersist}
+option, you could customize the variable
+@code{tramp-ssh-controlmaster-options} to use your @code{ControlPath},
+for example:
+
+@lisp
+(setq tramp-ssh-controlmaster-options
+      (concat
+        "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
+        "-o ControlMaster=auto -o ControlPersist=yes"))
+@end lisp
+
+Note, that "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and
+"%%p", respectively.  The entries of @code{ControlPath},
+@code{ControlMaster} and @code{ControlPersist} can be removed from
+this setting, if they are configured properly in your
+@file{~/.ssh/config}:
+
+@lisp
+(setq tramp-ssh-controlmaster-options "")
+@end lisp
+
+
 @item
 File name completion does not work with @value{tramp}