How FTP Server sets permissions for uploading files under Linux

Source: Internet
Author: User
1, first use VI to open vsftpd.conf vsftpd configuration file

Under Ubuntu is

Vi/etc/vsftpd.conf

Under CentOS is

Vi/etc/vsftpd/vsftpd.conf

This may be different under different systems.

2. Find Unmsk default is 022, modify the permissions you want to be able to.

3. The following is the specific meaning of Unmsk

Umask is typically used to give permissions when you initially create a directory or file.

The permissions on the file x represent execution, this risk is too high, so the general permission initial assignment must be removed from the X

The first 0 represents the permission that suid discards; (generally omitted)

The second 0 indicates that the file/directory owner has no permissions to discard (except for the file, x permission);

The third 2 user group representing this file/directory discards the W permission (if it is a file then its X permission is discarded);

The third 2 means that other users of this file/directory can use only R and X (except files).

In general, if you create a new file, then its permissions are:-wr-w--w--is: 644

If you create a new directory, then its permissions are: Dwrxw-xw-x is: 755

4, how to calculate Unmsk

1) directory Permissions rwx r-x r-x (755) This is the directory creation default permissions

Directory permissions: 777-unmsk The resulting value

2) file Permissions rw-r--r--(644) This is the file creation default permission
File permissions: 666-unmsk The resulting value

How FTP Server sets permissions for uploading files under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.