jsjcjsjc
V2EX  ›  问与答

这个 chown 命令咋写哈~~

  •  
  •   jsjcjsjc · Oct 23, 2022 · 2455 views
    This topic created in 1472 days ago, the information mentioned may be changed or developed.

    安装了 webdav 服务端 sftpgo 其他都完美,但是自定义目录的时候发现 sftpgo 没有权限访问. 想问一下如何设置"/root/sftpgo" 目录的权限可以让 sftpgo 访问哈

    测试了一下直接这样是不行啊 chown -vR sftpgo:sftpgo /root/sftpgo

    需要这样才可以~~ chown -vR sftpgo:sftpgo /root

    但是还是想问一下,有办法只给 sftpgo:sftpgo 用户 /root/sftpgo 的权限码?

    作者的回复如下,不是很专业啊,求 MJJ~~ make sure that the sftpgo system user has at least the read permission to any parent directory, so in the example above /home/username and /home must not have 0700 permissions

    感谢

    14 replies  •  2022-11-14 00:15:44 +08:00
    PMR
    PMR
    Oct 23, 2022 via Android❤️1
    1
    chmod -R 777 /root
    ysc3839
    ysc3839
    Oct 23, 2022 via Android❤️1
    2
    /root 还是没权限呀,别放 /root 下面,放 /home 下面
    swulling
    swulling
    Oct 23, 2022 via iPhone
    3
    @PMR NB !
    swulling
    swulling
    Oct 23, 2022 via iPhone❤️1
    4
    @ysc3839 正解,/root 下别放非 root 用户的东西
    dsrdbh
    dsrdbh
    Oct 23, 2022 via Android
    5
    setfacl
    dsrdbh
    dsrdbh
    Oct 23, 2022 via Android
    6
    @dsrdbh 同时,关闭 selinux
    jsjcjsjc
    jsjcjsjc
    OP
    Oct 23, 2022
    7
    @PMR 哥们,这个我懂~~
    jsjcjsjc
    jsjcjsjc
    OP
    Oct 23, 2022
    8
    @ysc3839 感谢
    正常是这样的,我就好奇有没有可能放在 root 下,并且只给 /root/sftpgo 的权限,个人使用,所以不纠结
    jsjcjsjc
    jsjcjsjc
    OP
    Oct 23, 2022
    9
    @dsrdbh ~~感谢,虽然看不懂,哈哈
    cpstar
    cpstar
    Oct 23, 2022
    10
    摔倒 /opt 下搞一个目录不好么?
    cpstar
    cpstar
    Oct 23, 2022
    11
    10# PATCH 甩到
    swulling
    swulling
    Oct 23, 2022 via iPad
    12
    @jsjcjsjc 可以 chmod 755 /root ,注意别加 R

    但是会降低安全性。
    bt7vip
    bt7vip
    Oct 23, 2022 via Android
    13
    目录没被占用的话,是可以正常修改,这个文件现在的权限和所有者是谁,听前面的一句话,不要放在 root 下,给 root777 也是离了大谱
    dsrdbh
    dsrdbh
    Nov 14, 2022 via Android
    14
    setfacl -R -m u:sftpgo:rwx /root
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1333 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 19:19 · PVG 03:19 · LAX 11:19 · JFK 14:19
    ♥ Do have faith in what you're doing.