1

I am not a sysadmin, so my knowledge is limited in this topic.

We have an apache with some virtualhosts. For some reason, the group of the files and directories is a gitusers, because we are using hooks on commit sometimes. Sometimes not, but I would like keep this.

Owner of files is www-data.

I've created a new ftp user (a real linux user), called: printftp without shell.

I've added this printftp user to the gitusers group.

Let's say, the directory of our http project is /var/www/print.example.com/www/

This is the home directory for printftp.

My problem is, all the new files created by this user will be: printftp:printftp

Is it possible to focrce the proftpd to inherit the owner and group from the /var/www/print.example.com/www/?

So all new files created by anyone should be: www-data:gitusers

And I also want to change 664 for files, and 775 for directories.

Thanks

vaso123
  • 235
  • 1
  • 4
  • 13

1 Answers1

2

You could create an extra file: /etc/proftpd/conf.d/printftp.conf with following configuration:

Umask                002  002
RequireValidShell    off
DefaultRoot          ~
UseReverseDNS        off

<IfModule mod_cap.c>
  CapabilitiesEngine off
</IfModule>

<Directory /var/www/print.example.com/www/>
  UserOwner   www-data
  GroupOwner  www-data
</Directory>

First part is the umask for your permissions, and second part is for setting the permissions. It's possible you need to tweak the config according to your needs.

Carl
  • 724
  • 3
  • 5
  • I put the file, and set real path. nem of file is the [username].conf and put it into the dir. Restarted the daemond, but no change. In my proftd.conf there is a line: `Include /etc/proftpd/conf.d/` Should I add my new file individally? – vaso123 Apr 06 '17 at 11:04
  • Nope, If I do mistake, when I restart I got error. So it reads it, but has no effect – vaso123 Apr 06 '17 at 11:17
  • Can you run proftp in foreground in debug modus? First stop the service and then run it with `sudo proftpd -d10 -n -c /etc/proftpd/proftpd.conf`. Put 1 file and look in the console. In my log I see `root chown(/test.log) to uid 1000, gid 1000 successful` – Carl Apr 06 '17 at 12:07
  • check http://vaso.hu/tmp/ Last line is the file. – vaso123 Apr 06 '17 at 12:28
  • Can you give me the output of `egrep -v "^#|^$" /etc/proftpd/proftpd.conf /etc/proftpd/conf.d/*.log` – Carl Apr 06 '17 at 12:58
  • For 1 week: https://pastebin.com/HQMsUgYW – vaso123 Apr 06 '17 at 13:09
  • And the files in `/etc/proftpd/conf.d/`? – Carl Apr 06 '17 at 13:11
  • Yes, and as I sad, it should definitely read it. I made intentionally a syntax error in the `conf.d/printerftp.conf` and when I tried to restart the daemon, it sad errors. I removed the syntax error, restart, and that was ok. – vaso123 Apr 06 '17 at 13:22
  • what is the content of `printerftp.conf`? – Carl Apr 07 '17 at 08:24