Forgot password?
 Create new account
View 104|Reply 0

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

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2022-7-18 04:01:25 |Read mode
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,升级到最新版可以解决此问题.

手机版Mobile version|Leisure Math Forum

2025-4-20 22:11 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list