如何保护 emacs 服务器的安全?
我想确保只有我可以连接到我初始化的 emacs 服务器。我经常使用其他人可以通过 SSH 访问的机器,而且我不知道有什么可以阻止他们打开 emacsclient
并运行 Mx Kill-emacs
这会让我陷入困境超过。
我查看了 emacsserver
和 emacsclient
的文档,但找不到我要找的内容。
有办法做到这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然,这是开箱即用的! Emacs 服务器创建一个只有您可以访问的套接字(权限为 600 或 700,在权限为 600 的目录中)。
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).
看起来您可以为服务器指定
server-socket-file
,为 emacsclient 指定server-socket-dir
。只需将套接字放置在只有您有权访问并且应该进行设置的目录中。It looks like you can specify
server-socket-file
for the server andserver-socket-dir
for emacsclient. Simply place the socket in a directory where only you have access and you should be set.