Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I secure an emacs-server?

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?

like image 364
Squidly Avatar asked May 07 '11 13:05

Squidly


People also ask

How do I use Emacsclient?

The simplest way to use the emacsclient program is to run the shell command ' emacsclient file ', where file is a file name. This connects to an Emacs server, and tells that Emacs process to visit file in one of its existing frames—either a graphical frame, or one in a text terminal (see Frames and Graphical Displays).

How can I tell if Emacs daemon is running?

1 Answer. Show activity on this post. Simply use (daemonp) which will return t if emacs is running as a daemon.


2 Answers

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).

like image 176
Gilles 'SO- stop being evil' Avatar answered Sep 22 '22 00:09

Gilles 'SO- stop being evil'


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.

like image 28
cnicutar Avatar answered Sep 22 '22 00:09

cnicutar