简体   繁体   中英

permissions - PHP and FTP

How to setup users/groups so both PHP/Apache and proFTPD has full access to files/dirs?

FTP user

Username: webadmin
User ID: 1001
Home dir: /var/www
Shell: /usr/sbin/nologin
Primary group: www-data

Move home dir if changed: yes
Change user ID on files: home dir
Change group ID on files: home dir
Modify user in other modules: yes

When logging in on the FTP with webadmin all files are listed but with no write rights!?

If you want to give multiple users access to something then you should use groups.

First make sure that all of your necessary web 'users' are members of a certain group, probably www-data.

usermod -a -G www-data webadmin

Add the user 'webadmin' to the 'www-data' group.

Next, change the group of the files to this group:

chgrp -R www-data files/dirs

Recursively set the group of files/dirs to www-data.

Finally, change the permissions of the directory in question to allow full access to all members of its group:

chmod -R g+rwx files/dirs

Recursively give group members read, write and execute permissions to files/dirs

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