Re: Emacs Tramp hangs with timeout when connecting to server with two-factor authentication from a Windows 11 machine via sshx/scpx
Michael Albinus <[email protected]> Fri, 21 Nov 2025 10:26:07 +0100
| Newsgroups | gmane.emacs.tramp |
|---|---|
| Message-ID | <[email protected]> |
--=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Alexei Srour <[email protected]> writes: > Hello Michael, Hi Alexei, > Notably, enabling the option `tramp-debug-to-file` did not actually > change anything? I attempted adjusting variables > `tramp-compat-temporary-file-directory` and `temporary-file-directory > ` but no result. Inspecting traces of various connections always had > the `temp-file` pointing at=20 > `C:/Users/name/AppData/Local/Temp/tramp.xxxxxx`, but I was never able > to find the file. I'll disregard the issue for the time being. Good catch! The file shall have a name like "c:/Users/albinus/AppData/Local/Temp/*debug tramp scpx albinus@gandalf*". Apparently, on MS Windows it doesn't work if a file name has a leading or trailing "*". I've fixed this in tramp-message (see appended patch); will also be fixed in the upcoming Tramp 2.8.0.5. > Inevitably, at some point today after hours of debugging and > documenting, Tramp began cooperating and creating a debug buffer for > my failed connections, no `temp-file` required. Hmm, this looks strange: =2D-8<---------------cut here---------------start------------->8--- > 14:36:32.794272 tramp-send-command (6) # ssh -l <user> -p <port> -e none= -t -t -o RemoteCommand=3D"/bin/sh -i" -o SetEnv=3D"TERM=3Ddumb" <ip addr= ess> && exit || exit > 14:37:30.478478 tramp-accept-process-output (10) # #<process *tramp/scpx= <user>@<ip address>#<port>*> run nil > ssh -l <user> -p <port> -e none -t -t -o RemoteCommand=3D"/bin/sh -i" -= o SetEnv=3D"TERM=3Ddumb" <ip address> && exit || exit > 14:37:30.482824 tramp-process-actions (3) # Waiting for prompts from rem= ote shell...failed > 14:37:30.483496 tramp-maybe-open-connection (3) # Opening connection for= <user>@<ip address>#<port> using scpx...failed =2D-8<---------------cut here---------------end--------------->8--- Tramp did wait for ~1 minute, but there's no output from ssh at all. Hmm. Which ssh client do you use? Call 'ssh -V'. IIRC, older ssh clients ceased to work on MS Windows. > Kind regards, > Alexei Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/tramp-message.el b/lisp/tramp-message.el index aafceaf3..05598bb4 100644 =2D-- a/lisp/tramp-message.el +++ b/lisp/tramp-message.el @@ -197,9 +197,13 @@ They are completed by `M-x TAB' only in Tramp debug b= uffers." (defun tramp-get-debug-file-name (vec) "Get the debug file name for VEC." (declare (tramp-suppress-trace t)) - (expand-file-name - (string-replace "/" " " (tramp-debug-buffer-name vec)) - tramp-compat-temporary-file-directory)) + (let ((buffer-name (tramp-debug-buffer-name vec))) + (expand-file-name + (string-replace + "/" " " + (if (eq system-type 'windows-nt) + (substring buffer-name 1 (1- (length buffer-name))) buffer-name)) + tramp-compat-temporary-file-directory))) =20 (defun tramp-trace-buffer-name (vec) "A name for the trace buffer for VEC." --=-=-=--