Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the permissions for uploading files by ftp server under linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Open the configuration file of vsftpd.conf vsftpd with vi first.

Under Ubuntu is

Vi / etc/vsftpd.conf

Under centos is

Vi / etc/vsftpd/vsftpd.conf

This may have different principles under different systems.

two。 Find the default unmsk is 022, change it to the permission you want.

3. Let's talk about the specific meaning of unmsk

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

The permission for x of the file represents execution, which is too risky, so the initial assignment of general permissions must remove the

The first 0 represents the permissions discarded by suid; (generally omitted)

The second 0 means that the owner of this file / directory has not discarded any permissions (except for x permissions in the case of files)

The third 2 represents the user group of this file / directory discarded the w permission (if it is a file, then its x permission is also discarded)

The third 2 represents that other users of this file / directory can only use r and x (except files).

To sum up, if you create a new file, its permissions are:-wr-w--w--: 644

If you create a new directory, its permissions are: dwrxw-xw-x: 755

4. How to calculate unmsk

1) Directory permissions rwx rmurx rmurx (755) this is the default permission for directory creation

Directory permissions: 777-the value obtained by unmsk

2) File permissions rw- rMui-rMui-(644) this is the default permission for file creation.

File permissions: value obtained by 666-unmsk

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report