Ownership Problem (I don't have Shell access)

udinnet

Member
Oct 18, 2010
14
0
51
Hi there,
I was having a big problem with new components installing via Joomla 1.5 and all the files that copied, became 99 ownership (nobody). I just checked the FTP layer settings of Joomla and there is no problem with those settings. When I uploading files via FTP client(fillezilla), that file have the correct ownership.

Now I got a big trouble with those files that I installed via joomla. I can't delete or do any thing to them. Please can you give me a procedure for set correct ownership for those files without using shell/SSH. I do read some post about setting ownership by corn-jobs. But I can't actually figure out how to do that.

Please can some one help me. Thanks.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
If you're not the Server Administrator, you'll need to contact them to help with this. To prevent this from being a problem in a the future, running SuPHP will help. The Server Administrator would need to implement this as well though, via Easy Apache from the server's WHM side of things.
 

udinnet

Member
Oct 18, 2010
14
0
51
If you're not the Server Administrator, you'll need to contact them to help with this. To prevent this from being a problem in a the future, running SuPHP will help. The Server Administrator would need to implement this as well though, via Easy Apache from the server's WHM side of things.
Thanks for the reply pro. But I'm getting my hosting facility via a reseller and I think he don't know how to configure SuPHP. Please can you mention any other way of chown files of my public_html directory.

I'm very hopeless at this moment and can do any work without a solution for this.

Thanks.
 

linux7802

Well-Known Member
Dec 14, 2007
232
1
68
cPanel Access Level
Root Administrator
To change the ownership from nobody to user, root login details required. You can't change ownership by using your reseller account login details. Its better if you contact your reseller account provider or upgrade your hosting plan from reseller to VPS or dedicated server. So that you can manage your own server. :)
 

udinnet

Member
Oct 18, 2010
14
0
51
I just implemented a cornjob and the code is

Code:
chown -R myusername:myusername /home2/myusername/public_html/*
But this is a sample of the mail I received by cornjobs and there are all the file that has the 99(nobody user). But neither any file been able to set again original ownership.

chown: changing ownership of `/home2/#####/public_html/plugins/user/phpbb3_user.php': Operation not permitted
chown: changing ownership of `/home2/#####/public_html/plugins/user/phpbb3_user.xml': Operation not permitted
Is this happening with the privileges with my Cpanel account.:confused:
Thanks.
 

udinnet

Member
Oct 18, 2010
14
0
51
Sorry!!! Just want to mention some thing. This server that my host is located is a Linux server.

And I can contact root administrator of this dedicated server. Can anyone give me the cornjob code which can use by the root admin of the server to chown my account's all files
. :)
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
A cron (not corn) job is a normal Linux command, set to run on a schedule. The problem with the cron job that you have tried to use is that you are trying to change the ownerships of files that are not "yours"; they are owned by nobody, not the cPanel account user. The root user could set up a cron job to change the ownerships of these files, since root has superuser privileges that a regular account user lacks.

What appears to me is that your host is using DSO (Apache module) as the PHP handler, and because of this, your sites scripts create files owned by the user nobody, since DSO runs PHP scripts as the nobody user. Because of this, you cannot change the ownerships of the files, since cPanel and FTP log you in as the account user, not nobody.

To avoid this, you may want to ask your host if he/she has considered changing to suPHP. With suPHP as the PHP handler, all files will be created as the account user, instead of nobody, and you would not encounter this problem.
 

udinnet

Member
Oct 18, 2010
14
0
51
A cron (not corn) job is a normal Linux command, set to run on a schedule. The problem with the cron job that you have tried to use is that you are trying to change the ownerships of files that are not "yours"; they are owned by nobody, not the cPanel account user. The root user could set up a cron job to change the ownerships of these files, since root has superuser privileges that a regular account user lacks.

What appears to me is that your host is using DSO (Apache module) as the PHP handler, and because of this, your sites scripts create files owned by the user nobody, since DSO runs PHP scripts as the nobody user. Because of this, you cannot change the ownerships of the files, since cPanel and FTP log you in as the account user, not nobody.

To avoid this, you may want to ask your host if he/she has considered changing to suPHP. With suPHP as the PHP handler, all files will be created as the account user, instead of nobody, and you would not encounter this problem.
Thankyou for your valuable words. I understood the situation verymuch.

According to your answer I think the root admin can set a cron job for only my account to chown files instead of configuring suPHP. Because suPHP work will confuse them. Am I correct? Then I will request him to do so.
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
A cron job would be the most direct way to fix your particular issue. I wanted to mention suPHP because it does provide greater security and avoids this type of issue, but it is not much more complex than DSO.

It is ultimately up to your host, however, and I only mentioned suPHP as a possibility, because it would be a way for your host to avoid having to create this type of cron job for each of his/her users, while at the same time having greater security.
 

udinnet

Member
Oct 18, 2010
14
0
51
Hi again
Now I'm having another problem with adding a cron job. I advised my hosting admin to add a cron job for every five minutes with below code.
Code:
chown -R myusername:myusername /home2/myusername/public_html/*
But he says that there is no place to put cron jobs in WHM. Should he use SSH? He tried to add a cron job to my cpanel via WHM. But the same problem occurred(Operation not permitted).
So please give me a idea and procedure with codes how to overcome this problem. Thank you very much.
 
Last edited:

linux7802

Well-Known Member
Dec 14, 2007
232
1
68
cPanel Access Level
Root Administrator
Hi again
Now I'm having another problem with adding a cron job. I advised my hosting admin to add a cron job for every five minutes with below code.
Code:
chown -R myusername:myusername /home2/myusername/public_html/*
But he says that there is no place to put cron jobs in WHM. Should he use SSH? He tried to add a cron job to my cpanel via WHM. But the same problem occurred(Operation not permitted).
So please give me a idea and procedure with codes how to overcome this problem. Thank you very much.
"Operation not permitted" error is occur because your hosting provide is setting cron under your cPanel hosting account, you can simply ask your hosting provider to add following corn in servers main cron file. Use following commands from shell to set cron.

1st) Login in to server as root user.

2nd) Open servers main cron file.


crontab -e
3rd) Insert following command in cronfile

*/5 * * * * find /home/cpanelUSERname/public_html/ -user nobody | xargs chown cpanelUSERname.cpanelUSERname
4th) Save file and restart the crond service.

In above cron command use your own cPanel user name instead of cpanelUSERname.
 
Last edited:

yapluka

Well-Known Member
Dec 24, 2003
301
1
168
France
cPanel Access Level
Root Administrator
Hi again
Now I'm having another problem with adding a cron job. I advised my hosting admin to add a cron job for every five minutes with below code.
Code:
chown -R myusername:myusername /home2/myusername/public_html/*
But he says that there is no place to put cron jobs in WHM. Should he use SSH? He tried to add a cron job to my cpanel via WHM. But the same problem occurred(Operation not permitted).
So please give me a idea and procedure with codes how to overcome this problem. Thank you very much.
If your sysadmin does not know how to create a cronjob as root, you also may want to consider moving to a more knowledgeable hosting company, lol :D

Best of luck with your host ;)
 

udinnet

Member
Oct 18, 2010
14
0
51
@linux7802

is the correct command
*/5 * * * * find /home/cpanelUSERname/public_html/ -user nobody | xargs chown cpanelUSERname.cpanelUSERname
or
*/5 * * * * find /home/cpanelUSERname/public_html/ -user nobody | xargs chown cpanelUSERname:cpanelUSERname
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
The chown command expects a user and group separated by a colon ( : ), so this would be correct:

Code:
*/5 * * * * find /home/cpanelUSERname/public_html/ -user nobody | xargs chown cpanelUSERname:cpanelUSERname