Possible Duplicate:
Open file via SSH and Sudo with Emacs
我想在 Emacs 上使用 TRAMP 在通过 ssh 连接的远程计算机上使用 sudo(例如/etc/hosts)打开文件。
我尝试了几个选项,但没有一个起作用。谁能告诉我该怎么做?
谢谢
最佳答案
在 .emacs 中使用以下内容
(set-default 'tramp-default-proxies-alist (quote ((".*" "\\`root\\'" "/ssh:%h:"))))
然后您只需输入:
C-x C-f /sudo:root@host[#port]:/path/to/file
它会要求您提供访问远程 shell 的密码,然后再次询问您的密码以进行 sudo 访问。
关于emacs - 如何在 Emacs 中将 SSH 和 SUDO 与 TRAMP 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3465567/