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
Printable View
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
You could login to the FTP server as www-data. :)
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'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>
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 ;)
I'm pretty sure it belongs to the user that uploads it, rather then the proftpd process.
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 greenfieldsupport
I tried putting likeQuote:
Originally Posted by webman
but its still owned by rob:robCode:<Directory /var/www>
UserOwner www-data
GroupOwner www-data
</Directory>
man chown
find | xargs chown owner:group
thats prettymuch the same as chown -R user:group dir isn't it?Quote:
Originally Posted by el8linuxel8
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.
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.Quote:
Originally Posted by fooby
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 stuffQuote:
Originally Posted by greenfieldsupport
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.
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
to proftpd.conf, restart daemon and voila, new files in that dir are owned by that group whoever uploads them.Code:<Directory /var/www/blah-blah>
GroupOwner www-data
</Directory>