本文介绍了如何使用Emacs tramp进行远程主机的ssh,并将其作为另一个用户进行临时编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想做的是在我梦寐以求的世界中:

>

/ myuser @ remotehost:sudo:anotheruser:/ some / path / to / file



...并且有ido -mode work。



这里的关键是'myuser','remotehost'和'anotheruser'都是非常特别的,我使用了一大堆远程主机,通常与不同的用户,并且适用于各种不同的用户。



我需要添加什么,如何测试它,而无需重新加载emacs

解决方案

截至,TRAMP再次支持ad-hoc多跳。



大致来说,您可以这样使用:

  / ssh:transituser @ remotehost | sudo:user @remotehost:/ some / file 

我没有使用 ido-mode 可靠地工作,这是一个耻辱,但它比没有好多了! : - )


/multi used to work for me, now it's gone and I'm frustrated.

What I want to do is, in my dream world:

/myuser@remotehost:sudo:anotheruser:/some/path/to/file

...and have ido-mode work.

The key thing here is that 'myuser', 'remotehost' and 'anotheruser' are all very ad-hoc, I use a huge array of remote hosts, often with different users and sudo-ing to a wide range of different users.

What do I need to add and how can I test it without reloading emacs over and over?

解决方案

As of this commit, TRAMP supports ad-hoc multiple hops again.

Roughly speaking, you use it like this:

/ssh:transituser@remotehost|sudo:user@remotehost:/some/file

I haven't got it to work reliably with ido-mode yet, which is a shame, but it's a lot better than nothing! :-)

这篇关于如何使用Emacs tramp进行远程主机的ssh,并将其作为另一个用户进行临时编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 07:15