Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-04 10:12:36

ultramega
Member
Registered: 2006-02-26
Posts: 221

Folder permissions, chmod

Which are correct chmod values for different TXP folders? Just want to check…

Offline

#2 2008-06-04 11:10:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Folder permissions, chmod

That totally depends on your server setup, but 777 is rarely the answer to that question.

Offline

#3 2008-06-04 11:24:46

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Folder permissions, chmod

ruud – won’t 777 for all folders permisions harm site’s security?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#4 2008-06-04 11:29:59

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Folder permissions, chmod

Yes (in most cases), which is why 777 is rarely the correct answer (read: permissions should be as strict as the server setup allows)

Offline

#5 2010-03-11 15:24:10

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Folder permissions, chmod

Hi, this is an old post but it seems it fits to my needs.

I’m moving my sites to another hosting (leaving MT if you must know, yes they were great but not any more, at least not for me).

Anyway, I took VPS, set everything, it’s all fine, but txp gives me errors in diagnostics that tmp, images and files are not writable.
But, when I chmod-em to 777 all fine!

I underastand that 777 is a security risk, and since I’m on a VPS and I can do whatever is necessarily on the LAMP, there must be a way to chmod this files to something else.

Anybody knows what should I do?

Thanks

Last edited by AndrijaM (2010-03-11 15:25:59)

Offline

#6 2010-03-11 20:12:40

AndrijaM
Member
From: Belgrade, Serbia
Registered: 2007-12-22
Posts: 190
Website

Re: Folder permissions, chmod

ok, I’ve found the solution, so here it is, if someone needs it:

Keep the permissions 755 (711, 700) and chown to the same user that runs the Apache. With Debian or Ubuntu, this will be the user “www-data”. The command is:

sudo chown -R www-data /path/to/folder

Last edited by AndrijaM (2010-03-11 20:13:12)

Offline

#7 2016-01-10 15:51:10

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Folder permissions, chmod

I know this old chestnut will make Ruud’s eyes roll, but I’ve always been confused about folder permissions and why permissions on….

  • /files
  • /images
  • /textpattern/tmp

constantly need to be fixed every time I move a site up to or down from production (at least it seems that way).

I keep hearing/seeing that 777 is not safe, and I have no doubt it’s not, but why is it most often the case that only 777 will work?

This isn’t just with web hosts, but my local setup too. The Txp help tip on the associated diagnostic recommends using 755, but I chmod away in Terminal and it works not. This has got to be a confusing/frustrating situation for people (besides me).

I’m curious about what Adrija is saying above, because I’ve not seen that mentioned before, but I don’t quite get what he’s saying. Is it relevant? Can someone clarify?

Offline

#8 2016-01-12 10:51:50

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Folder permissions, chmod

Destry wrote #297327:

This isn’t just with web hosts, but my local setup too. The Txp help tip on the associated diagnostic recommends using 755, but I chmod away in Terminal and it works not. This has got to be a confusing/frustrating situation for people (besides me).

Same here … and I chmod away in Transmit (777 it is) … for years now … :(

Last edited by RedFox (2016-01-12 10:52:39)

Offline

#9 2016-01-12 17:00:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Folder permissions, chmod

If 777 works and 755 does not (for folders), then the folders are owned by a different user than the user of the Apache daemon (or whatever webserver software you use). Two ways to solve that:
  • chown the directories/files to the webserver daemon user.
  • change the webserver configuration so PHP scripts for your website are run under your username.

Offline

#10 2016-01-20 10:18:37

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Folder permissions, chmod

ruud wrote #297355:

change the webserver configuration so PHP scripts for your website are run under your username.

Know a source that explains that a bit more? Where I would go in the haystack and what I would do when I got there…

Offline

#11 2016-01-20 17:52:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Folder permissions, chmod

If you’re using Apache, google for mod_ruid2

Offline

#12 2016-01-20 19:22:51

kai
Member
From: Hamburg
Registered: 2008-10-08
Posts: 45
Website

Re: Folder permissions, chmod

Destry wrote #297500:

Know a source that explains that a bit more? Where I would go in the haystack and what I would do when I got there…

Maybe this could be interesting: processwire.com/docs/security/file-permissions/

Last edited by kai (2016-01-20 19:47:02)

Offline

Board footer

Powered by FluxBB