Function: tramp-enable-nc-method

tramp-enable-nc-method is an autoloaded and byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-enable-nc-method)

Documentation

Enable "ksu" method.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
;;;###tramp-autoload
(defun tramp-enable-nc-method ()
  "Enable \"ksu\" method."
  (add-to-list 'tramp-methods
               `("nc"
                 (tramp-login-program        "telnet")
                 (tramp-login-args           (("%h") ("%p") ("%n")))
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
                 (tramp-remote-shell-args    ("-c"))
                 (tramp-copy-program         "nc")
                 ;; We use "-v" for better error tracking.
                 (tramp-copy-args            (("-w" "1") ("-v") ("%h") ("%r")))
                 (tramp-copy-file-name       (("%f")))
                 (tramp-remote-copy-program  "nc")
                 ;; We use "-p" as required for newer busyboxes.  For
                 ;; older busybox/nc versions, the value must be
                 ;; (("-l") ("%r")).  This can be achieved by tweaking
                 ;; `tramp-connection-properties'.
                 (tramp-remote-copy-args     (("-l") ("-p" "%r") ("%n")))))

  (add-to-list 'tramp-default-user-alist
	       `(,(rx bos "nc" eos) nil ,(user-login-name)))

  (tramp-set-completion-function "nc" tramp-completion-function-alist-telnet))