Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-03-2006, 10:52 AM
|
#1
|
LQ Newbie
Registered: Feb 2004
Posts: 6
Rep:
|
Proftpd-How Do You Change The Permissions On A File From Anonymous Upload
How do you change the file permissions on a file uploaded by an anonymous user so that they are not owned by user 'ftp'. I did a chmod g+s on /incoming so files are owned by a different group than 'ftp' but the chmod u+s does not change the owner from ftp. I would like to add something to my proftpd.conf to do this....
Thanks in advance
|
|
|
03-07-2006, 04:53 AM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
How do you change the file permissions on a file uploaded by an anonymous user so that they are not owned by user 'ftp'.
- think about switching to Vsftpd or Muddleftpd, these FTP daemons have a much better track record when it comes to security,
- rethink your FTP strategy. Anonymous users should better *not* be allowed to upload files without restrictions,
- read Proftpd docs config example about separate up and download dirs, then use something simple like Watchfile (see Freshmeat.net) or a cronjob to move files from up to download dir.
I did a chmod g+s
Change owner = chown, not chmod.
I would like to add something to my proftpd.conf to do this.
Wouldn't know how to do this with Proftpd. Maybe someone else knows.
|
|
|
03-07-2006, 05:07 AM
|
#3
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Quote:
Originally Posted by unSpawn
How do you change the file permissions on a file uploaded by an anonymous user so that they are not owned by user 'ftp'.
- think about switching to Vsftpd or Muddleftpd, these FTP daemons have a much better track record when it comes to security,
- rethink your FTP strategy. Anonymous users should better *not* be allowed to upload files without restrictions
|
I agree with unSpawn : Proftp, eventhough it is installed on some security products has suffered some security problems.
And for anonymous , if they are allowed to upload files, they could upload illegal stuffs and then you are responsible.
The most important thing is : if you really have to do it, then be sure to not share your ftp_root with your apache_root otherwise you're really asking for trouble ;-)
|
|
|
03-07-2006, 09:27 AM
|
#4
|
LQ Newbie
Registered: Feb 2004
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
How do you change the file permissions on a file uploaded by an anonymous user so that they are not owned by user 'ftp'.
- think about switching to Vsftpd or Muddleftpd, these FTP daemons have a much better track record when it comes to security,
- rethink your FTP strategy. Anonymous users should better *not* be allowed to upload files without restrictions,
- read Proftpd docs config example about separate up and download dirs, then use something simple like Watchfile (see Freshmeat.net) or a cronjob to move files from up to download dir.
I did a chmod g+s
Change owner = chown, not chmod.
I would like to add something to my proftpd.conf to do this.
Wouldn't know how to do this with Proftpd. Maybe someone else knows.
|
I have setup incoming and outgoing directories so that when an anonymous user uploads a file the files user:group change to a local user:group. All anonymous can do is 'ls' the file if they know the filename. They cannot download anything from incoming. They cannot upload anything to outgoing only download from it if they know the filename. They are chrooted also.
Also to fix my problem I added a +CAP_CHOWN so that files uploaded by anonymous change automatically to a local user. Thanks for the input. I will checkout freshmeat.net 
|
|
|
03-07-2006, 09:30 AM
|
#5
|
LQ Newbie
Registered: Feb 2004
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by nx5000
I agree with unSpawn : Proftp, eventhough it is installed on some security products has suffered some security problems.
And for anonymous , if they are allowed to upload files, they could upload illegal stuffs and then you are responsible.
The most important thing is : if you really have to do it, then be sure to not share your ftp_root with your apache_root otherwise you're really asking for trouble ;-)
|
Would running the deamon as a nopriv users with no shell take care of this or is there something similiar to the .ftpusers setting in vsftpd 
|
|
|
03-07-2006, 09:48 AM
|
#6
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
I don't run any ftp server (because I don't really like this protocol) so I can't reliably answer your question: I don't know what is .ftpusers.
But yes, your ftp server has to drop its privileges (I guess it needs to be root for opening a port < 1024) to a normal user as soon as possible. Also disable his shell, yes. I think its the same for apache by default.
If somebody manages to upload a php script and your php server doesn't disable some features, then he can run what he wants. Same goes for cgi.
|
|
|
All times are GMT -5. The time now is 02:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|