简体   繁体   English

冒险使用Forever + Sudo来保持节点应用的运行?

[英]Risky Using Forever + Sudo to keep node app running?

Is it risky to keep a node.js application running as sudo using forever.js? 使用forever.js将node.js应用程序作为sudo运行是否有风险? What potential problems are there? 有什么潜在的问题? If this is ill-advised what is a better alternative? 如果这是不明智的什么是更好的选择?

Running an app via sudo is indeed highly risky. 通过sudo运行应用程序确实非常危险。 Your app will have full root privileges meaning the number of possible attacks and severity of possible attacks is significantly higher than if you ran your application as a dedicated user for this application. 您的应用程序将具有完全root权限,这意味着可能的攻击次数和可能的攻击严重程度显着高于您作为此应用程序的专用用户运行应用程序时。 I strongly recommend following the industry best practices here and running your application as a normal non-root user. 我强烈建议您遵循此处的行业最佳做法,并以普通的非root用户身份运行您的应用程序。

As to forever this category of software is generally called "process supervision" and there are many non-risky options available. 至于forever这类软件通常被称为“过程监督”,并且有许多非风险选项可用。 I personally use the process supervision system built into my deployment OS, which is currently upstart or systemd , but I think forever is one of several alternatives that are perfectly fine. 我个人使用我的部署操作系统中内置的过程监控系统,该操作系统目前是upstartsystemd ,但我认为forever是完全正常的几种替代方案之一。 I recommend Process Supervision: Solved Problem as a good overview of process supervision with some good insights. 我建议过程监督:解决问题作为过程监督的一个很好的概述,并提供一些好的见解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM