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.
|
 |
01-24-2006, 06:10 AM
|
#1
|
LQ Newbie
Registered: Jan 2006
Posts: 1
Rep:
|
File write permissions of 777 and 755
I have a web server with several domains hosted on it and have some folders set to 777 to allow (usually shopping carts) to write text files and upload images etc.
I have been hacked and all folders set to 777 have had files written to them which caused shopping carts etc to malfunction.
If I set the permissions to less than 777 I am unable to write successfully. Some servers are able to set permissions lower than 777 (say 755) others are not. I beleive this may be related to the PHP user which is usually set to 'nobody'.
I am getting a new server (with Fedora Core Linux) - how can this be set up so that PHP scripts within a domain can write to folders set lower than 777?
|
|
|
01-24-2006, 07:41 AM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,508
Rep:
|
I do not believe your site was cracked because the folders/files permissions. A more logical cause is a bug in your php scripts that allow the attacker gain a shell with the same previlegies the php user has.
Anyway, change the owner of folders and files to the same php user. chmod -R nobody:nobody /path/to/your/rootdocumentfolder and chmod -R go-rwx /path/to/your/rootdocumentfolder.
good luck next time,
|
|
|
01-24-2006, 08:12 AM
|
#3
|
Senior Member
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460
Rep:
|
And if you don't want/can't set the files to be owned by the PHP user, then set the 'group' permissions to 7 and make sure that the PHP user is a member of the same group that owns the files.
|
|
|
All times are GMT -5. The time now is 07:53 PM.
|
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
|
|