Page 1 of 1

Messed up public web permissions

Posted: 10 Jan 2008, 08:17
by GaryL
Last night I was uploading webpages and images etc to /home/web/ .
I was using a mixture of Dream weaver, SmartFTP and Filezilla to upload from different PC’s. At one point I was also using 2 users, my personal username and the admin username.

Within doing this I have seemly messed things up. Images won't display and I now I get a, you don't have permission to access this area messages, when I try to browse webpages within sub-directories of /home/web/.

Filezilla tells me that users root, admin, and garyl are all owners of different files within the web directory and the chmod settings for files and folders are all over the place. No consistency at all in regards to permissions.

How can I correct this? Filezilla won't let me chmod some files/folders.
Everything uploaded to /home/web/ is static content. No scripts of any sort. Just basic html pages and images.

Posted: 10 Jan 2008, 10:00
by JohanSalo
try the command

chown!

Posted: 10 Jan 2008, 14:24
by GaryL
sorry im a linux newbie.

how do I use the command chown.

and what user / user group should /home/web/ be set to?
and what permissions should i set /home/web/ to?

Posted: 10 Jan 2008, 15:53
by Eek
Hi

This is probably easiest:
If you can get on the bubba using ssh
switch to the root user and change the ownership of all the files in the /home/web directory to your personal username

Code: Select all

su -
chown -R garyl /home/web/*

Posted: 10 Jan 2008, 16:02
by GaryL
although that would probably sort my problems out, would that not cause problems for other users trying to upload to the /home/web/ folder.
should it not be some sort of all users group?

Posted: 10 Jan 2008, 16:08
by tor
Hi GaryL

If you are able to log in to bubba via ssh. Become root and do something like:

Code: Select all

cd /home
chown -R root:users web
find web/ -type d -exec chmod 0775 {} \;
find web/ -type f -exec chmod 0664 {} \;
Sorry for not having a nicer solution. I realise that this could look cryptic. But what it does is first changing owner of all files and directories to be owned by root and the group users. The next line changes permissions on all directories and the last one does the same on all files.

I hope this fixes things.

/Tor

Posted: 10 Jan 2008, 16:34
by GaryL
perfect, that fixed it.

many thanks.