- Get path of remote socket: execute on remote host
emacs --batch --execute "(progn (require 'server) (princ (expand-file-name \"remote\" server-socket-dir) #'external-debugging-output))"
- Get path of local socket: execute on local host
emacs --batch --execute "(progn (require 'server) (princ (expand-file-name server-name server-socket-dir) #'external-debugging-output))"
- Create SSH connection: execute on local host
ssh -v -N -R /run/user/1000/emacs/remote:/var/folders/gk/rnw58qsx7t30_4rsndpzwww80000gn/T/emacs501/server remotehost
- Launch
emacsclient
: execute on remote hostemacsclient -s remote -T /ssh:remotehost: .
- Configure
~/.ssh/config
on local host to obviate need for-R
option on command lineHost remotehost RemoteForward /run/user/1000/emacs/remote /var/folders/gk/rnw58qsx7t30_4rsndpzwww80000gn/T/emacs501/server StreamLocalBindUnlink yes
Last active
November 28, 2024 20:45
-
-
Save RhubarbSin/3e66d067e0ca7702e9c1278258a81b1c to your computer and use it in GitHub Desktop.
Use SSH to forward local Emacs server socket to remote host so emacsclient on remote host can open buffers in Emacs on local host
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment