Most active commenters
  • jonnycomputer(5)

←back to thread

Making TRAMP faster

(coredumped.dev)
226 points celeritascelery | 11 comments | | HN request time: 0.987s | source | bottom
1. jonnycomputer ◴[] No.44356898[source]
I kinda gave up on using it because so many of my remotes are tunneled through a jump host and I never could get it to connect seamlessly. It seems like it ought to, but when vscode just works with my ssh config, I decided debugging it was not a good use of my time. Might have something to do with being on a Mac, idk.
replies(4): >>44357207 #>>44357418 #>>44357476 #>>44361649 #
2. gray_-_wolf ◴[] No.44357207[source]
I found https://www.gnu.org/software/tramp/tramp-emacs.html#Multi_00... to be working pretty well, but it definitely took some fiddling and experimentation to get the right settings.
replies(1): >>44357267 #
3. jonnycomputer ◴[] No.44357267[source]
Thanks.

Someday I'll get to fiddling with it again.

4. aidenn0 ◴[] No.44357418[source]
I found that setting (customize-set-variable 'tramp-use-connection-share nil) made things "just work" with my .ssh config (the documentation for that variable seems to imply this is expected).

If you still want connection sharing, you'll have to set it in your .ssh config, but it works without it.

replies(1): >>44362064 #
5. jerf ◴[] No.44357476[source]
I think that in general, if you're doing anything fancy with SSH, you're better off setting it up in SSH than trying to convince Tramp to do anything with it. See something like https://wiki.gentoo.org/wiki/SSH_jump_host . Basically, the goal is you should be able to type "ssh someSSHConfig" and get to the shell of the device. If you can do that, you don't need to worry about what Tramp can and can't do, and if SSH adds a feature that works in the SSH config you don't even have to wonder if Tramp can use it.

And then it also works with everything else that works with SSH.

replies(1): >>44362051 #
6. dietr1ch ◴[] No.44361649[source]
You can jump through bastion hosts transparently™ with ~/ssh:you_but_jumping@bastion|ssh:you@remote:path/to/file~ (https://stackoverflow.com/a/16408592)

The thing that I had to fiddle with, was getting ssh and tramp to use the same ControlPath to share sockets because it helped make things smooth if you had setup ssh to use ssh-agent and persist connections already.

But yeah, I get why just giving up on tramp has been easier over the years. Besides connecting there's also annoyances on spotty internet that make avoiding it usually a better experience. I think I haven't relied much on tramp after trying to use it and realising tmux+emacs was overall better at the time, mainly because I could just hop on my workstation to the exact same session I was using once RTO happened. Nowadays I use it mostly for sudo and one off things, but not remote projects with remote compile and lsp anymore.

7. jonnycomputer ◴[] No.44362051[source]
Oh I have .ssh/config like:

    Host vm3
    User myusername
    HostName the-host-name
    ProxyCommand ssh -W %h:%p myusername@jump.host.address

So will jump through automatically using my ssh keys. Its very convenient. But Tramp doesn't seem to respect that configuration, or demands that I use a password instead of the ssh keys (its been awhile since I've last tried, so I kinda am dim on the details of what was the hassle)
replies(2): >>44362101 #>>44364942 #
8. jonnycomputer ◴[] No.44362064[source]
I'll give that a try maybe.
9. jonnycomputer ◴[] No.44362101{3}[source]
Actually I just tried it and it worked like a charm. I used ssh:myusername@vm3, I wonder if I was trying a different protocol before? bit confused what might have changed tbh
replies(1): >>44366221 #
10. pabs3 ◴[] No.44364942{3}[source]
ISTR ProxyJump is in some way better than ProxyCommand btw.
11. jerf ◴[] No.44366221{4}[source]
That makes sense. I wasn't sure where to go after that because it has always just worked for me. You can also embed your username into the config, FWIW, making it just "/ssh:vm3:".