Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
lisisi
V2EX  ›  Linux

修改权限后 chmod -R 644 /var/app/files 动态创建的子文件夹,权限可以继承吗?

  •  
  •   lisisi · Oct 28, 2024 · 2280 views
    This topic created in 746 days ago, the information mentioned may be changed or developed.

    在应用程序中,为了让用户对于 app/files 都有访问下载文件的权限,修改权限后:

    chmod -R 644 /var/app/files

    再在 files 路径下,应用程序动态创建的 files/user_1, files/user_2, files/user_3... 这些子文件夹,还能继承 644 权限吗?

    7 replies  •  2024-10-29 09:34:37 +08:00
    xuyan1994
    xuyan1994
    Oct 28, 2024
    1
    chown 下,然后用应用程序相关的用户执行就可以
    adoal
    adoal
    Oct 28, 2024
    2
    在启动程序的脚本或者 systemd unit 里设置 umask
    dinghmcn
    dinghmcn
    Oct 28, 2024
    3
    不能,文件默认权限由楼上说的 umask 决定,可以直接使用 umask 命令查看
    AlohaV2
    AlohaV2
    Oct 28, 2024
    4
    chmod g+s?
    yulgang
    yulgang
    Oct 28, 2024
    5
    在 /var/app/files 创建随机文件的命令前设置 umask 022 ,或者在执行二进制程序前先指定 umask 022
    guo4224
    guo4224
    Oct 29, 2024 via iPhone
    6
    umask
    swLoXtOtd89pGg8t
    swLoXtOtd89pGg8t
    Oct 29, 2024
    7
    sudo setfacl -Rdm u:username:rwx /path
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1957 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 01:05 · PVG 09:05 · LAX 17:05 · JFK 20:05
    ♥ Do have faith in what you're doing.