Jump to content

Recommended Posts

Posted

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

Posted

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)

Posted

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 ;)

Posted

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

Posted
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.

Posted
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.

Posted
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
Posted

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.

  • 2 years later...
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 47 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...