简体   繁体   中英

Linux set permissions to folder (ftp and Apache2)

I set up a folder (/srv/www/). In this folder, all Apache virtual hosts are located. For example;

  • /srv/www/domain.com
  • /srv/www/domain2.com

I created a group ftp-users and executed the following commands:

  1. groupadd ftp-users
  2. chmod 755 /srv/www
  3. chown root:ftp-users /srv/www

Whenever I upload a file to /srv/www/domain.com/public_html/ it gets CHMOD 600 by default, this has to be 755.

How do I do this?

Using Debian Squeeze, Apache and vsFTPd.

From the vsftpd manpage:

file_open_mode The permissions with which uploaded files are created. Umasks are applied on top of this value. You may wish to change to 0777 if you want uploaded files to be executable. Default: 0666

local_umask The value that the umask for file creation is set to for local users. NOTE! If you want to specify octal values, remember the "0" prefix otherwise the value will be treated as a base 10 integer! Default: 077

Play around with theese two values to achiev what you want ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM