AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1003349
Accepted
beard black
beard black
Asked: 2020-02-18 00:35:13 +0800 CST2020-02-18 00:35:13 +0800 CST 2020-02-18 00:35:13 +0800 CST

按照 tomcat, security 的手册以非 root 用户身份启动 tomcat

  • 772

我阅读了tomcat apache的手册,他们告诉以非root身份运行tomcat,但我应该给root所有权,并且组tomcat应该只有读取权限。只给我组tomcat读取权限,我怎样才能以非root身份启动服务?这不是矛盾吗?

资源:

Tomcat should not be run under the root user. Create a dedicated user for the 
Tomcat process and provide that user with the minimum necessary permissions 
for the operating system. For example, it should not be possible to log on 
remotely using the Tomcat user.
aking the Tomcat instances at the ASF as an example (where auto-deployment is 
disabled and web applications are deployed as exploded directories), the 
standard configuration is to have all Tomcat files owned by root with group 
Tomcat and whilst owner has read/write privileges, group only has read and 
world has no permissions. The exceptions are the logs, temp and work 
directory that are owned by the Tomcat user rather than root.

我目前以 tomcat 的身份运行该服务,权限为 750 和文件夹 /tomcat 的所有权 tomcat:tomcat 。

tomcat linux ubuntu security
  • 1 1 个回答
  • 2884 Views

1 个回答

  • Voted
  1. Best Answer
    Piotr P. Karwasz
    2020-02-18T01:50:53+08:002020-02-18T01:50:53+08:00

    您应该区分两个概念:

    • Tomcat 进程的凭据。这应该以非特权用户身份运行:在您的示例中,用户tomcat、组。tomcat这样 Tomcat 就不能执行保留给用户root的任何操作(参见不完整列表的功能)。
    • Tomcat 文件的文件权限(参见Unix 模式)。这些文件中的大多数对于 Tomcat 进程来说很容易成为只读文件,并且可能应该如此。这通常通过将这些文件的所有者设置为root(只有所有者可以更改文件权限)、组tomcat和删除w组和其他人的权限标志来获得。

    所以里面$CATALINA_BASE:

    • 对于 Tomcat,几乎所有文件夹都应该是只读的,尤其是bin,conf和lib,
    • webapps可以读写,但只有在应用部署时才需要,之后可以设置为只读,
    • temp并且work应该是Tomcat 进程的读写(可能只是 Tomcat 进程)。
    • 1

相关问题

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve