From da1ad851b2bebe2774ce7da66b7864576feb0944 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 3 Sep 2017 17:55:28 +0100 Subject: [PATCH] Fix Tramp connections --- modules/emacs.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/emacs.el b/modules/emacs.el index 0360f27..bbfe731 100644 --- a/modules/emacs.el +++ b/modules/emacs.el @@ -182,7 +182,14 @@ (use-package tramp :defer t :config - (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))) + (setq-default tramp-default-method "ssh") + ;; This line proxies all sudo connections via an ssh connection to the + ;; provided hostname. + (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:")) + ;; This rule is an exception to the above so that local sudo does not proxy + ;; via ssh. This has to be added last so that it is the first element of + ;; the list. + (add-to-list 'tramp-default-proxies-alist '("localhost" "\\`root\\'" nil))) ;; -------------------------------------------------------------------------- ;; Configure garbage collection.