[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2 tramp problems

From: Alex V. Koval
Subject: 2 tramp problems
Date: Sat, 03 Nov 2018 11:27:12 +0200

Hi Michael,

I am happy to write to you again, and for a start I would like to tell
you big BIG THANK YOU! For providing this excellent tramp module which I and
thousands of emacs users are using worldwide! I am software developer
and DevOps and this exact feature makes my life so much better!

Nice to meet you again, btw I have seen your youtube videos, it was nice
to see you in live mode in video :-)

Both my problems are not urgent, but it makese sense to fix them earlier
or later. OK, so switching to actual problems:

One problem is this (easy to reproduce)

1. As example I am taking remote server 'hosting' where 2 facts are
 - I have address@hidden account
 - There is *no* ubuntu@ account on that host

2. Assume I forget that I have to login to root@ directly, and trying to
do it via 'ubuntu' account first:

 Trying to open:

 leads to:

 Tramp: Opening connection for address@hidden using sudo...
 Tramp: Sending command ‘exec ssh -l ubuntu   -e none hosting’
 Tramp: Waiting for prompts from remote shell...
 Tramp: Sending password

3. Now, I see this prompt for password, I realize that I should be
   logging there directly. I try to do it, now directly:

   Tramp: Waiting for prompts from remote shell...
   Tramp: Sending password
   Tramp: Waiting for prompts from remote shell...failed
   Tramp: Opening connection for address@hidden using ssh...failed

   .. so the problem is that despite the fact that now I am specifying
   /ssh:address@hidden: directly, it still tries to invoke ssh:ubuntu@

   tramp-cleanup-all-connections does not help.

2nd problem

I have 2nd problem, and I am not sure if this is reflection 1st or
something else. Sometimes, I can have several paths to connect to remote
host. For example:

This paths allows me to use custom defined 'docker' tramp method
which I use to connect to docker container in privileged mode on hosting


But then, I might connect to the same site using direct 'ssh' when
container has ssh access:


I am not sure if different #port here is causing this but it still tries
to connect to previous host using root ->docker path. Again, this does
not help:

M-x tramp-cleanup-all-buffers
M-x tramp-cleanup-all-connections

and so in such case I have to restart emacs completely to get to host

Would be great if you advice me what to do or find out how to fix those

JFYI as a DevOps I find it very useful to be able to connect into
Docker, Openshift and Kubernetes containers with a great tool which
Emacs is (not only editor, but org-mode and other things makes it easy
to execute/filter results etc). Here are my custom connectors (up to you
may me makes sense to include some of them into official support):

;; Problem with su: often many system accounts are hidden under /sbin/nologin 
due to reasons explained here:
;; ... as result 'su' won't work, but with lisp it is easy to define 'sush' 
which will do -s /bin/sh
  '((tramp-login-program "su")
  (tramp-login-args (("-") ("%u") ("-s" "/bin/sh")))
  (tramp-remote-shell "/bin/sh")
  (tramp-connection-timeout 10)))

;; from
(setq remote-file-name-inhibit-cache nil)
(setq vc-ignore-dir-regexp
      (format "%s\\|%s"
(setq tramp-verbose 1)

  '((tramp-login-program "oc")
    (tramp-login-args (("rsh") ("%h") ("/bin/sh")))
    (tramp-remote-shell "/bin/sh")
    (tramp-remote-shell-args ("-i"))))

  '((tramp-login-program "kubectl")
    (tramp-login-args (("exec") ("%h") ("-it") ("/bin/sh")))
    (tramp-remote-shell "/bin/sh")
    (tramp-remote-shell-args ("-i"))))

WBR, and again thank you! 
Alex V Koval

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]