3

I have a debian with pure ftpd installed with virtual users.

I used the documentation for my setup so the local account of pure ftpd is ftpuser:ftpgroup When a user uploads a file, the file is owned by ftpuser:ftpgroup. I want the uploaded file to be owned by another system user (mylocaluser). I added my virtual user this way :

pure-pw useradd uploadimages -u mylocaluser -d /var/www/mysite/current/images
Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Jérémie
  • 133
  • 1
  • 4

1 Answers1

5

Pure-FTPD has something like MYSQLGetUID and MYSQLGetGID for specifying queries to get UID/GID. Depending on your mysql table you can use something like this:

MYSQLGetUID    SELECT Uid FROM ftpd WHERE User="\L" AND status="1"
MYSQLGetGID    SELECT Gid FROM ftpd WHERE User="\L" AND status="1"

under the MYSQLGetPW query definition. More info in documentation fo Pure-FTPD, section MySQL authentication


OK, my bad I didn't read carefully that you're using PureDB to store users. After you create user you can modify it's info like this:

pure-pw usermod uploadimages -u UID -g GID

then check with pure-pw show uploadimages if the UID/GID are correct.

Dawid
  • 198
  • 1
  • 6
  • Thks! I was using -u mylocaluser and it seems to work better with the UID. OR maybe you have to provide a group GID too. – Jérémie Aug 27 '12 at 07:31