+ Post New Thread
Results 1 to 14 of 14
*nix Thread, ProFTPD owner of files in Technical; Hey all does anyone know how on EARTH to get files that i copy onto a server through proftpd so ...
  1. #1

    Join Date
    Feb 2006
    Location
    Staffordshire
    Posts
    134
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    ProFTPD owner of files

    Hey all

    does anyone know how on EARTH to get files that i copy onto a server through proftpd so they're owned by like www-data or at least so thats the group?!

    thanks

    -Rob

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: ProFTPD owner of files

    You could login to the FTP server as www-data.

  3. #3

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,422
    Thank Post
    645
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: ProFTPD owner of files

    Add apache and proftpd to a common group and grant full read/write permissions to that group on desired folder? In theory?

    (Check UserOwner/GroupOwner directives in the proftpd conf file)

  4. #4
    greenfieldsupport's Avatar
    Join Date
    Mar 2007
    Location
    Newton Aycliffe, Durham
    Posts
    240
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    16

    Re: ProFTPD owner of files

    I'm pretty sure it belongs to the user that uploads it, rather then the proftpd process.

    add the group to your user.

    at the console:

    usermod -g www-data <username>

  5. #5
    greenfieldsupport's Avatar
    Join Date
    Mar 2007
    Location
    Newton Aycliffe, Durham
    Posts
    240
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    16

    Re: ProFTPD owner of files

    yes it is...

    see our www root looks like this :

    int:/var/www# ls -l
    total 10060
    drwxrwxr-x 7 root www-data 4096 2006-12-06 09:59 21cs
    drwxr-xr-x 2 root root 4096 2007-08-31 08:38 apache2-default
    drwxr-xr-x 11 ronco www-data 4096 2006-12-14 11:32 BusinessRes
    drwxrwx--- 16 root www-data 4096 2006-11-09 11:46 community
    drwxr-xr-x 2 ronco www-data 4096 2007-01-11 17:20 Content Guides
    drwxr-xr-x 15 ronco www-data 4096 2006-12-01 10:31 CrocChemSim
    drwxr-xr-x 3 ronco www-data 4096 2006-11-30 17:31 CrocPhysBlocks
    drwxr-xr-x 4 ronco www-data 4096 2006-11-30 17:35 CrocPhysBooks
    drwxr-xr-x 2 ronco www-data 4096 2007-08-30 11:45 drivers
    drwxr-xr-x 5 ronco www-data 4096 2007-01-30 14:27 ICT Boardworks
    -rw-r--r-- 1 ronco www-data 1370 2007-02-05 14:31 index.html
    drwxr-xr-x 14 ronco www-data 4096 2007-06-21 15:53 Joomla
    drwxr-xr-x 6 ronco www-data 4096 2006-12-05 09:27 JSHBiology
    drwxr-xr-x 6 ronco www-data 4096 2006-12-05 09:46 JSHChemistry
    drwxr-xr-x 5 ronco www-data 4096 2006-12-05 10:01 JSHKS3
    drwxr-xr-x 5 ronco www-data 4096 2006-12-05 09:57 JSHPhysics
    drwxr-xr-x 9 ronco www-data 4096 2006-12-05 10:12 JSHScience
    drwxr-xr-x 5 ronco www-data 4096 2006-12-07 15:31 KS3 Powerpoint
    -rw-rwxr-- 1 root www-data 42474 2007-02-05 14:18 logo.jpg
    drwxr-xr-x 32 www-data www-data 4096 2007-07-03 11:37 moodle
    -rw-r--r-- 1 root root 10132892 2007-06-26 09:42 moodle-latest-18.tgz
    drwxr-xr-x 15 ronco www-data 4096 2006-12-01 10:58 OmniGres
    drwxr-xr-x 3 ronco www-data 4096 2006-12-07 15:29 Radlab
    drwxrwx--- 32 ronco www-data 4096 2007-01-11 15:22 resources
    drwxrwx--- 2 aharris www-data 4096 2007-01-23 13:59 revideo
    drwxr-xr-x 30 ronco www-data 4096 2007-01-10 20:52 RMDA French
    drwxrwx--- 7 www-data www-data 4096 2007-10-17 14:16 staffnet
    drwxr-xr-x 6 ronco www-data 4096 2007-10-16 16:49 studentnet


    as you can see the user changes, but they all have the group www-data

    hmmm and www-data has write access for alot of them... thats not right .. lol brb while i chmod 744 that folder

  6. #6

    Join Date
    Feb 2006
    Location
    Staffordshire
    Posts
    134
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: ProFTPD owner of files

    I'm pretty sure it belongs to the user that uploads it, rather then the proftpd process.

    Quote Originally Posted by greenfieldsupport
    add the group to your user.

    at the console:

    usermod -g www-data <username>
    Yeah it does, it belongs to rob only trouble is, I don't really want EVERYTHING I upload to belong to www-data, just ideally only in that directory!

    Quote Originally Posted by webman
    Add apache and proftpd to a common group and grant full read/write permissions to that group on desired folder? In theory?

    (Check UserOwner/GroupOwner directives in the proftpd conf file)
    I tried putting like
    Code:
    <Directory /var/www>
    UserOwner   www-data
    GroupOwner   www-data
    </Directory>
    but its still owned by rob:rob

  7. #7

    Join Date
    Nov 2007
    Location
    Preston
    Posts
    98
    Thank Post
    2
    Thanked 4 Times in 4 Posts
    Rep Power
    15

    Re: ProFTPD owner of files

    man chown

    find | xargs chown owner:group

  8. #8

    Join Date
    Feb 2006
    Location
    Staffordshire
    Posts
    134
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: ProFTPD owner of files

    Quote Originally Posted by el8linuxel8
    man chown

    find | xargs chown owner:group
    thats prettymuch the same as chown -R user:group dir isn't it?
    I don't want to do it manually, I want to be able to use the FTP server and the files I drop in the dir be owned by the right person. I'm not sure if its even possible anymore.

  9. #9
    fooby's Avatar
    Join Date
    Dec 2005
    Posts
    351
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    20

    Re: ProFTPD owner of files

    its possible in the proftpd settings to override the user assigned there. vsftpd does this too (which i use)

  10. #10

    Join Date
    Feb 2006
    Location
    Staffordshire
    Posts
    134
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: ProFTPD owner of files

    Quote Originally Posted by fooby
    its possible in the proftpd settings to override the user assigned there. vsftpd does this too (which i use)
    hmm How do you do it in vsftp? I could just switch my ftp Daemon.

  11. #11
    greenfieldsupport's Avatar
    Join Date
    Mar 2007
    Location
    Newton Aycliffe, Durham
    Posts
    240
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    16

    Re: ProFTPD owner of files

    How about you create a new user, for uploading to that directory, you can even set that dir as their home dir so as soon as they log in ftp they get placed exactly in the place they need to be

  12. #12

    Join Date
    Feb 2006
    Location
    Staffordshire
    Posts
    134
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: ProFTPD owner of files

    Quote Originally Posted by greenfieldsupport
    How about you create a new user, for uploading to that directory, you can even set that dir as their home dir so as soon as they log in ftp they get placed exactly in the place they need to be
    The plan was for multiple users but its only a minor annoyance anyway. We'll probably just chown them manually whenever we upload stuff

  13. #13
    fooby's Avatar
    Join Date
    Dec 2005
    Posts
    351
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    20

    Re: ProFTPD owner of files

    I use vsftpd and webmin to manage it with the vsftpd plugin. but it can be set in the setup files for the vsftpd server.

    or as geoff said in the first reply, logon as www-data - we do that here too since its easier.

  14. #14

    Join Date
    Nov 2010
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Stumbled upon this tread when googling about the same problem, and found answer in other search results.

    Proftpd has a convenient way to do this kind of stuff, just add

    Code:
    <Directory /var/www/blah-blah>
      GroupOwner www-data
    </Directory>
    to proftpd.conf, restart daemon and voila, new files in that dir are owned by that group whoever uploads them.



SHARE:
+ Post New Thread

Similar Threads

  1. MSI Files.
    By boomam in forum How do you do....it?
    Replies: 14
    Last Post: 9th November 2007, 01:50 PM
  2. .nrg files HELP!
    By thegrassisgreener in forum Windows
    Replies: 5
    Last Post: 6th September 2007, 07:57 PM
  3. proftpd mysql module
    By edie209 in forum *nix
    Replies: 2
    Last Post: 13th July 2007, 01:28 PM
  4. WDS and .WIM files.
    By starscream in forum Wireless Networks
    Replies: 1
    Last Post: 4th July 2007, 03:37 PM
  5. Playing Avi Files
    By lee_sri in forum Windows
    Replies: 11
    Last Post: 10th February 2006, 03:34 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •