0

i've created a proftpd server with users managed by a mysql server. But i've a problem with my users. When one of my users is connected on the server, he can upload/download/delete files but there is a problems with the folders.

When a user create a folder, he can't open/delete it.

But when I check permissions on my system, folder got more permission than files.

When i make ls -lah it give me back this :

-rw-r--r--. 1 ftpuser ftpgroup 859K  5 juil. 15:18 Chrysanthemum.jpg
-rw-r--r--. 1 ftpuser ftpgroup 827K  5 juil. 15:18 Desert.jpg
-rw-r--r--. 1 ftpuser ftpgroup 582K  5 juil. 15:18 Hydrangeas.jpg
-rw-r--r--. 1 ftpuser ftpgroup 758K  5 juil. 15:18 Jellyfish.jpg
-rw-r--r--. 1 ftpuser ftpgroup 549K  5 juil. 15:18 Lighthouse.jpg
drwxr-xr-x. 2 ftpuser ftpgroup    6  5 juil. 15:21 test
-rw-r--r--. 1 ftpuser ftpgroup 607K  5 juil. 15:18 Tulips.jpg

And I can't delete or open my folder test.

The system is CentOS7 with SElinux in permissive mode

Proftpd -vv return this :

ProFTPD Version: 1.3.5e (maint)
Scoreboard Version: 01040003
Built: Wed May 3 2017 14:58:47 UTC

Loaded modules:
 mod_quotatab_sql.c
 mod_quotatab/1.3.1
 mod_sql_mysql/4.0.8
 mod_sql/4.3
 mod_vroot/0.9.2
 mod_ctrls_admin/0.9.7
 mod_lang/1.0
 mod_ctrls/0.9.5
 mod_cap/1.1
 mod_memcache/0.1
 mod_tls/2.6
 mod_auth_pam/1.2
 mod_readme/1.0
 mod_ident/1.0
 mod_dso/0.5
 mod_facts/0.4
 mod_delay/0.7
 mod_site.c
 mod_log.c
 mod_ls.c
 mod_auth.c
 mod_auth_file/1.0
 mod_auth_unix.c
 mod_rlimit/1.0
 mod_xfer.c
 mod_core.c

Thank by advance

1 Answers1

0

The folder getting "more permissions" is working as intended, since you need X to traverse it. As far as the amount of permissions, you should check your Umask directive in your proftpd config.

http://www.proftpd.org/docs/howto/Umask.html

The other option is to set default ACLs & sticky bits on your user folders.

Ulfy
  • 351
  • 1
  • 5
  • Hi, thanks for your feedback, but I tried to set Umask to 000 and nothing happened. I will try with ACLs. – Timoté Brusson Jul 12 '17 at 10:07
  • Hi, I've tried ACLs with this command : `setfacl -Rm user:ftpuser:rwx /srv/ftp`. It work when I'm connecting to the server with SSH but with FTP it doesn't works – Timoté Brusson Jul 17 '17 at 12:35
  • Can you tell me more about your ftp users and groups? Do you have multiple ftp user accounts that are rooted to their own dir? And ftp accounts part of the group `(ftpgroup)`? What I usually expect is to have an account associated with each folder under your `/srv/ftp`, which they are the User of. And some internal/management users that are part of an ftp group that can traverse all user folders. Say.... /srv/ftp/client1 = client1:ftpgroup.... /srv/ftp/client2 = client2:ftpgroup, etc – Ulfy Jul 18 '17 at 01:00
  • All of my FTP users are rooted on there own directory with the instruction : `DefaultRoot ~ !adm` in my conf file. My virtual users are using the same account on my system (ftpuser (UID 2001) which is in the group ftpgroup (GUID 2001). Virtual users are mapped to the real user with my database. Each virtual user got one work folder. I cannot set permission like /srv/ftp/client1 = client1:ftpgroup cause users client1 doesn't really exists on my server – Timoté Brusson Jul 18 '17 at 10:13