如何使用 Emacs trapmp ssh 到远程主机并以另一个用户的身份临时编辑文件?
/multi 曾经为我工作,现在它消失了,我很沮丧。
我想做的是,在我的梦想世界中:
/myuser@remotehost:sudo:anotheruser:/some/path/to/file
...并进行 ido 模式工作。
这里的关键是“myuser”、“remotehost”和“anotheruser”都是非常临时的,我使用大量的远程主机,通常使用不同的用户并对各种不同的用户进行 sudo。
我需要添加什么以及如何在不一遍又一遍地重新加载 emacs 的情况下测试它?
/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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自 此提交,TRAMP 再次支持临时多跳。
粗略地说,你可以这样使用它:
我还没有让它在 ido-mode 下可靠地工作,这很遗憾,但总比没有好得多! :-)
As of this commit, TRAMP supports ad-hoc multiple hops again.
Roughly speaking, you use it like this:
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 文件中,它似乎来自这里: http://atomized.org/2011/01/toggle- Between-root-non-root-in-emacs-with-tramp/
我没有广泛使用它,但似乎这是朝着正确方向迈出的一步。
The following code may help:
I had it in my .emacs file, and it seems to come from here: http://atomized.org/2011/01/toggle-between-root-non-root-in-emacs-with-tramp/
I haven't used it extensively but it seems like that is a step in the right direction.