简体   繁体   English

带流浪模式的Emacs

[英]Emacs with Tramp mode

After doing TONS of research on every stack overflow question there is and every page that google pulls up on the subject, I am unable to get sudo to work in Emacs with Tramp mode. 在对每个堆栈溢出问题以及Google在该主题上的每个页面进行了大量研究之后,我无法使用samp在Tramp模式下的Emacs中工作。 (Yes, I have read all the 'duplicate' questions here on stack overflow and none of the solutions work for me.) (是的,我在这里阅读了所有关于堆栈溢出的“重复”问题,没有一种解决方案适合我。)

Using Emacs 24.5.1 with the following configuration. 使用具有以下配置的Emacs 24.5.1。

(use-package tramp
    :config (progn (setq tramp-default-proxies-alist (quote ((".*" "\'root\'" "/ssh:%h:"))))
              (require 'tramp)
              (tramp-mode 1)))

When I try: 当我尝试:

/ssh:user@hostname.com|sudo:hostname /ssh:user@hostname.com|sudo:hostname

or: 要么:

/sudo:hostname.com /sudo:hostname.com

and many, many other combinations . 以及许多其他组合。 . .

. . . the minute I type the colon after 'sudo' in any syntax configuration it immediately throws an error stating that sudo can only be used locally. 在任何语法配置中,我在'sudo'之后键入冒号的那一刻,它立即引发错误,指出sudo只能在本地使用。

BONUS QUESTION: can I use Tramp to first log into a remote server as myself and sudo to another generic sudo userid there after? 奖励问题:我可以使用Tramp首先以我自己的身份登录到远程服务器,然后在sudo上登录另一个通用sudo userid吗? Like ssh:my_userid@remote_host.com|sudo:generic_userid@remost_host.com:/path/to/file 像ssh:my_userid@remote_host.com | sudo:generic_userid@remost_host.com:/ path / to / file

Any help appreciated. 任何帮助表示赞赏。

Forget setting tramp-default-proxies-alist for the time being. 暂时忘记设置tramp-default-proxies-alist Just open Cx Cf /ssh:user@hostname.com|sudo:hostname.com: . 只需打开Cx Cf /ssh:user@hostname.com|sudo:hostname.com: I also don't understand what setting tramp-mode shall be good for. 我也不明白设置tramp-mode应该适合什么。

BONUS ANSWER: yes. 奖金解答:是的。 Your example needs a leading / , 'tho. 您的示例需要以/开头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM