找回密码
 快速注册
搜索
查看: 43|回复: 0

umask 修改ftp上传的文件的默认权限

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2022-7-18 04:01 |阅读模式


Set umask in vsftpd so incoming files have 644 permissions
For text files, I like the permissions to be 644, which is rw-r--r-- (read-write for user, read for group, read for the world). To get this in vsftpd, uncomment this line:
local_umask=022
How does local_umask and file_open_mode work?

The vsftpd daemeon will create file permissions as 0777. From that, the local_umask ( 0011 ) is subtracted. The umask essentially removes the permissions you don't want users to have. This results in the user's file permissions to be set at 0766.

For more information, see this article about file permissions.

help umask

umask: umask [-p] [-S] [mode]
    Display or set file mode mask.

    Sets the user file-creation mask to MODE.  If MODE is omitted, prints
    the current value of the mask.

    If MODE begins with a digit, it is interpreted as an octal number;
    otherwise it is a symbolic mode string like that accepted by chmod(1).

    Options:
      -p        if MODE is omitted, output in a form that may be reused as input
      -S        makes the output symbolic; otherwise an octal number is output

    Exit Status:
    Returns success unless MODE is invalid or an invalid option is given.
例如
umask 0000
如果设置无效,可能是因为FileZilla issue,升级到最新版可以解决此问题.

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:54

Powered by Discuz!

× 快速回复 返回顶部 返回列表