0

I think this is a simple issue of file permissions but I don't have enough knowledge. :(

My htdocs directory (in Ubuntu) earlier had 770 permissions, because I thought "who would want to view this other than me?" but then I saw that even the browser wasn't able to read the files. So I changed the permissions to 775 but now the IDEs I'm using to write code tell me that the file is read-only. Does that mean the IDEs get classified into the "others" group?

What is the solution? Do I always have to run the IDEs as root? And what are the correct file permissions so that when I upload these to my live server there won't be a problem?

ankush981
  • 5,159
  • 8
  • 51
  • 96
  • What user and group are the owner of the directory? And what user and group are you running your IDE under? – fvu Jan 14 '14 at 14:55
  • The owner and group are 'root'. At least that's what ls -l tells me. Now how do I find out the group and user of the IDE? I guess the user is the account name I've used to log in? – ankush981 Jan 14 '14 at 14:58
  • 1
    Indeed - and as the files are root.root and you will be something like you.users, they are actually readonly for your user. – fvu Jan 14 '14 at 15:04
  • I think you should take a look at this: http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt – shihab13rocks Jan 14 '14 at 15:22
  • @fvu Thanks! For now I've changed the owner and group to my name, and am happy for now! ^.^ – ankush981 Jan 14 '14 at 16:01
  • @shihab13rocks It's a great link, but I'm in super hurry right now. I've marked it as my favorite and will be pursuing it later. Thanks a lot! – ankush981 Jan 14 '14 at 16:02
  • @fvu please tell me something: I set the permissions to 770 and the browser (Chrome) wasn't able to load the files, even though I changed the group and owner recursively to myself and am able to edit files in the IDE. Does this mean Chrome is not running in my name? If not, how come the IDE is? – ankush981 Jan 14 '14 at 16:08
  • 770 doesn't seem like a good idea, other should at least have read access (5) - otherwise the webserver (typically runs as its own user) won't have access. There's a pretty strong relationship between the rights and the ownership, so if you changed ownership all of a sudden accesssibility for all users changes... – fvu Jan 14 '14 at 16:15
  • @fvu point noted! I'll keep that in mind. :) – ankush981 Jan 14 '14 at 16:20

1 Answers1

0

Indeed - and as the files are root.root and you will be something like you.users, they are actually readonly for your user. – fvu

Armali
  • 18,255
  • 14
  • 57
  • 171