Mintsoft Posted November 21, 2007 Posted November 21, 2007 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
Geoff Posted November 21, 2007 Posted November 21, 2007 You could login to the FTP server as www-data.
webman Posted November 21, 2007 Posted November 21, 2007 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)
greenfieldsupport Posted November 21, 2007 Posted November 21, 2007 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
greenfieldsupport Posted November 21, 2007 Posted November 21, 2007 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
Mintsoft Posted November 21, 2007 Author Posted November 21, 2007 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 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! 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 UserOwner www-data GroupOwner www-data but its still owned by rob:rob
el8linuxel8 Posted November 26, 2007 Posted November 26, 2007 man chown find | xargs chown owner:group
Mintsoft Posted November 28, 2007 Author Posted November 28, 2007 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.
fooby Posted November 28, 2007 Posted November 28, 2007 its possible in the proftpd settings to override the user assigned there. vsftpd does this too (which i use)
Mintsoft Posted November 28, 2007 Author Posted November 28, 2007 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.
greenfieldsupport Posted November 28, 2007 Posted November 28, 2007 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
Mintsoft Posted November 28, 2007 Author Posted November 28, 2007 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
fooby Posted November 28, 2007 Posted November 28, 2007 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.
pavel_sutyrin Posted November 1, 2010 Posted November 1, 2010 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 GroupOwner www-data to proftpd.conf, restart daemon and voila, new files in that dir are owned by that group whoever uploads them.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now