summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
Diffstat (limited to 'init.org')
-rw-r--r--init.org35
1 files changed, 35 insertions, 0 deletions
diff --git a/init.org b/init.org
index 0b7cee8..ce160f7 100644
--- a/init.org
+++ b/init.org
@@ -369,6 +369,40 @@ All of this should be loaded lazily.
(require 'org)
#+END_SRC
+* Editing files on remote systems
+:PROPERTIES:
+:noweb-ref: tramp
+:END:
+
+TRAMP is a really convenient way to edit files on remote systems from
+within the comfort of my cozy customised local Emacs session. I use
+it to edit files at work, to edit things on my server =elephly.net=,
+and even to edit things as root on the local system.
+
+#+BEGIN_SRC elisp
+(require 'tramp)
+(setq tramp-default-method "ssh")
+
+(setq tramp-default-proxies-alist
+ (list
+ ;; Do not use a proxy on the same system.
+ '((regexp-quote (system-name)) nil nil)
+ ;; For root connections to remote hosts, log in via ssh with normal
+ ;; user account first, then su/sudo to root
+ '("elephly\\.net\\'" "\\`root\\'" "/ssh:%h:")
+ ;; Pass through ssh1 as user ‘rwurmus’ to reach remote hosts on
+ ;; MDC network.
+ '("mdc-berlin\\.net" "\\`rwurmus\\'" "/ssh:rwurmus@ssh1.mdc-berlin.de:")))
+
+;; ssh1 runs a restricted shell session, so "exec ssh" cannot be used.
+(add-to-list 'tramp-restricted-shell-hosts-alist
+ "\\`ssh1\\.mdc-berlin\\.de\\'")
+
+;; respect the PATH variable on the remote machine
+(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
+(setq tramp-verbose 3)
+#+END_SRC
+
* Shell
:PROPERTIES:
:noweb-ref: shell
@@ -454,6 +488,7 @@ put them all together to build the init file
<<initial>>
<<packages>>
<<default-fonts>>
+<<tramp>>
<<shell>>
<<initial-after-packages>>
<<org-mode>>