Page 1 of 1

CHMOD settings in ftp after upgrade

Posted: Wed Feb 02, 2011 2:02 am
by rj
I upgraded Serendipity today (it made blog a lot faster) and just checked my FTP permissions.
The ftp program I use with FIREFOX.
It now has everything at 777. Public read, write and execute checked everywhere
All serendipity folders, files and public_HTML which everything else is in.
What should it all be Please?
Thanx
RJ

Re: CHMOD settings in ftp after upgrade

Posted: Wed Feb 02, 2011 4:27 am
by Don Chambers
Permissions are discussed here: http://www.s9y.org/36.html#A5

You definitely do not want all files and folders to be world writable. Also make absolutely sure that you have changed any previously used FTP credentials.

Re: CHMOD settings in ftp after upgrade

Posted: Wed Feb 02, 2011 6:22 am
by rj
Messing this CHMOD stuff up is how I got in trouble in the first place.
:)

So the groups are OWNER, GROUP and PUBLIC
I assume only PUBLIC needs to be protected.
775 is PUBLIC read on, PUBLIC execute on and PUBLIC write off. Everything at the moment is 777. I dont know why that is, but it is.

So as I want most everything to be 775 I would go up to the domain root, the "html_public" folder, click properties (include all files) and make it 775. This would take an hour I bet. Then I go to the very few files that need to be public write on, like templates C and uploads and turn public write back on? Or does anything have to be public write on?

Re: CHMOD settings in ftp after upgrade

Posted: Wed Feb 02, 2011 4:07 pm
by garvinhicking
Hi!

First you need to check as what user your webserver (=PHP) runs. This is one "person" that needs access. Let's say, PHP runs as "wwwrun-rj".

Now you yourself want access with FTP, too. Let's say your username is "rj".

So you need to make sure that the user of your webserver runs in the same group like your FTP user. Let's say both wwwrun-rj and rj are members of the group "web-rj".

What you can do now is to change the ownership of ALL files and directory to user "rj", group "web-rj". Then change the permissions for the owner (first bit) to "7" (rwx). This will allow your FTP user to have full access to everything. The other bits are "00", so the full permission bitmask would be "700".

Now to ensure access to all s9y files, assign the permissions for the group (second bit) to "7" (rwx), but nly to those files and directories that are mentioned in the s9y FAQ. Like templates_c, serendipity_config_local.inc.php. This will basically set all those files/dirs to "770".

All other files will be left unmodified, which means that "other users" will always have no access to your files.

Now, depending on your provider this setup may vary, so you might need to react differently to what he enforces. :-)

(In a usual setup, the files you upload to FTP are always assigned to your FTP user, and the only things you need to change is to give write privilegs to the files mentioned in the s9y FAQ. But the FAQ, for ease of use, tells users to use '777', because we cannot anticipate every possible variation in a hoster's setup. 777 will always work, but will always be 'too broad'. But better to have a working setup for an installation than to confuse users with the security intrinsical features. But since you are eager to know, you'll need to get yourself familiar with the user/owner/group permission bits.)

Regards,
Garvin