[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp SUDO remote and localhost

From: Tory S. Anderson
Subject: Re: Tramp SUDO remote and localhost
Date: Tue, 30 Aug 2016 13:52:11 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

This is just terrific; thanks! I didn't realize that Tramp had a manual. This fixes things!

Michael Albinus <address@hidden> writes:

address@hidden (Tory S. Anderson) writes:

Hi Tory,

I have the following in my config files:

(add-to-list 'tramp-default-proxies-alist
'(nil "\\`root\\'" "/ssh:%h:") ;;

This causes tramp (which I'm using through Helm) to let me sudo into any of the many remote servers I work with (assuming they have ssh keys configured). However, now I can't do find-file /sudo::<local_path> as it tries to ssh to localhost. Is there any way I can keep the over-weighing benefit of sudo remote hosts while also being able to sudo locally?

The Tramp manual discusses exactly this case:

(add-to-list 'tramp-default-proxies-alist
             '(nil "\\`root\\'" "/ssh:%h:"))
(add-to-list 'tramp-default-proxies-alist
             '((regexp-quote (system-name)) nil nil))

Be careful to apply both forms in this order, the second rule must be
the first on in `tramp-default-proxies-alist'. See also

(info "(tramp) Multi-hops")

- Tory

Best regards, Michael.

Tory S. Anderson, Lead Application Developer
BYU Office of Digital Humanities
JFSB 1163F

reply via email to

[Prev in Thread] Current Thread [Next in Thread]