Kawili-wili
Kawili-wili

Reputation: 439

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. (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.

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

When I try:

/ssh:[email protected]|sudo:hostname

or:

/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.

BONUS QUESTION: can I use Tramp to first log into a remote server as myself and sudo to another generic sudo userid there after? Like ssh:my_userid@remote_host.com|sudo:generic_userid@remost_host.com:/path/to/file

Any help appreciated.

Upvotes: 1

Views: 1134

Answers (1)

Michael Albinus
Michael Albinus

Reputation: 1656

Forget setting tramp-default-proxies-alist for the time being. Just open C-x C-f /ssh:[email protected]|sudo:hostname.com:. I also don't understand what setting tramp-mode shall be good for.

BONUS ANSWER: yes. Your example needs a leading /, 'tho.

Upvotes: 2

Related Questions