7

I'd like to ensure that only I can connect to an emacs server that I initialised. I frequently use machines that other people could be SSH'd into, and I don't see what's to stop them opening emacsclient and running M-x kill-emacs which would screw me over.

I looked at the documentation for emacsserver and emacsclient but couldn't find what I was looking for.

Is there a way to do this?

Squidly
  • 2,707
  • 19
  • 43

2 Answers2

7

That happens out of the box, of course! The Emacs server creates a socket that only you can access (permissions 600 or 700, in a directory with permissions 600 for good measure).

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
3

It looks like you can specify server-socket-file for the server and server-socket-dir for emacsclient. Simply place the socket in a directory where only you have access and you should be set.

cnicutar
  • 178,505
  • 25
  • 365
  • 392