Jump to content
Sign in to follow this  
oscommerce21

Message: I am able to write to the configuration file - can not change permissions

Recommended Posts

Folks!

 

Please suggest, below is a message on the top of the website:

 

"I am able to write to the configuration file: /home/free/public_html/includes/configure.php"

 

I am changing permissions to 444, save, upload, and it reads on the site again as 644.

 

Here is the website:

 

http://goo.gl/jPJbY

 

Thank you!

 

Merry Christmas!

post-254285-0-87033800-1323718627_thumb.png

Edited by oscommerce21

Share this post


Link to post
Share on other sites

Some webhosts do not allow 444 to be set via a web based file manager. That is also true for FTP as well.

 

However usually on those configurations I have found that PHP has owner level privaleges anyways so you can use PHP itself to change the permissions.

 

Try this below.

 

Make a file, call it whatever you want and add the following code.

 

<?php
 error_reporting(0);
   if ( ( !chmod( "includes/configure.php", 0444 ) ) ||
	 ( !chmod( "admin/includes/configure.php", 0444 ) ) ) {
	 header( "Location: ./index.php" );
  }
?>

 

Upload it into your catalog directory for your shop and then browse to it in your web browser.

 

It should set both config files to 444 for you.

 

If you have changed the name of your admin directory, then replace the 'admin' in the code above with your new admin name.

 

Once its done then you can safely delete the file you used to make the change.

Edited by Taipo

- Stop Oscommerce hacks dead in their tracks with osC_Sec (see discussion here)
- Another discussion about infected files ::here::
- A discussion on file permissions ::here::
- Site hacked? Should you upgrade or not, some thoughts ::here::
- Fix the admin login bypass exploit here
- Pareto Security: New security addon I am developing, a remake of osC_Sec in PHP 5 with a number of fixes
- BTC:1LHiMXedmtyq4wcYLedk9i9gkk8A8Hk7qX

Share this post


Link to post
Share on other sites

How did you attempt to change the permissions? Many servers are now configured to silently ignore chmod requests from FTP clients. Try using your hosting service control panel > file manager. I don't quite follow your sequence of 'changing permissions to 444, save, upload'. If already 444 on the host, you need to change it back to 644 before uploading. Once the file has been updated on the host (after uploading), you change it to 444. You don't do anything to the file on your PC -- just to the one on the host (site).

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×