LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Running Chown on my linux server now I am locked out. (https://www.linuxquestions.org/questions/linux-general-1/running-chown-on-my-linux-server-now-i-am-locked-out-4175594010/)

tommytx 11-21-2016 11:49 PM

Running Chown on my linux server now I am locked out.
 
In an attempt to correct ownership on some of my directories I did the following thing..
chown retspro:retspro public_html and all seemed well but when i tried to get into my site it says not authorized.. can anyone tell me what ownership i changed that I should not have..
I did match it up with the ownership of another working site on teh same server (that did not get the ownership change) and they seem similar..
All files and directories that I checked did have retspro as owner and user.. but now I cannot access the site.

I can get onto cpanel and ftp is fine and i did look for an htacess file blockign me to no avail.. plus it did not have an htaccess so why should it have one now..

lazydog 11-22-2016 11:02 AM

First question was everything working before you run chown?
If it was then why did you change it?

rtmistler 11-22-2016 11:23 AM

Member Response
 
You said "directories", therefore my guess is that public_html is a directory?

Be aware of a couple of things. First there are files in that directory and they were not affected by your chown command. In order to do this you should use the -R argument to recurse down directories and change the ownership of all the contained files. Next, you say you have a parallel site where you wished to match the ownership. Get a long listing of the directories and files and examine all the attributes of ownership, group membership, and privileges. You may need to also perform a chmod command to adjust privileges. You may have assumed that the username matches the group, and this may be an incorrect assumption. The long listing command is:
Code:

ls -l

notKlaatu 11-22-2016 12:00 PM

For a website to be accessible to people on the Internet, the web directory must be readable by 'others'.

Can you verify that you public_html directory has permissions like: rwxrwxr-- (sometimes written as 774). The important one is the final triad: `r--` meaning that other people (not the user retspro, and not the group retspro, but other people visiting your site from the outside world) have read permissions.

ondoho 11-26-2016 04:31 AM

https://www.linuxquestions.org/quest...me-4175594127/
maybe helpful?

c0wb0y 11-28-2016 08:26 PM

Quote:

Originally Posted by notKlaatu (Post 5633433)
For a website to be accessible to people on the Internet, the web directory must be readable by 'others'.

Can you verify that you public_html directory has permissions like: rwxrwxr-- (sometimes written as 774). The important one is the final triad: `r--` meaning that other people (not the user retspro, and not the group retspro, but other people visiting your site from the outside world) have read permissions.

I beg to differ. It must be readable by httpd instead, no need to provide 'o' readability.


All times are GMT -5. The time now is 06:08 PM.