Linux Help: How To Change User Ower All Sub Directory and Directories Command

Mobile
feeds
Welcome Login | Register


Linux Help: How To Change User Ower All Sub Directory and Directories Command
Linux Help: How To Change User Ower All Sub Directory and Directories Command This page contains information about Linux Help: How To Change User Ower All Sub Directory and Directories Command Here you can also give your thought about the subject of Linux Help: How To Change User Ower All Sub Directory and Directories Command


Main List


Linux Help: How To Change User Ower All Sub Directory and Directories Command

By: Unix Admin

I had a situation where I transfered a directory to a linux server, when I did, it automatically gave owership to the root user (since i was logged in as root). But when I FTP and I wanted to change things, I couldn't I kept getting some error:

 

 /html/phpmyadmin  loaded from [Directory Listing Cache]\DIR22.tmp
site chmod 777 /html/phpmyadmin/config.inc.php
550 /html/phpmyadmin/config.inc.php: Operation not permitted

 

when I did a list command to list the owerner it showed root at the user and group. I wanted to change it to another user. the command I used was:

 

 ls -la

 

When I executed this command it displayed the following:

 [root@myserver www]# ls -la
total 68
drwxr-xr-x  9  webmaster  webmaster 4096 Jun 27 21:46 .
drwxr-xr-x 27 root            root      4096 Jun 17 18:14 ..
drwxr-xr-x  2  root            root      4096 Feb 11 15:12 cgi-bin
drwxr-xr-x  3  root            root      4096 Jun 17 15:28 error
drwxr-xr-x 28 root            root      4096 Jun 27 22:29 html
drwxr-xr-x  6  admin         users     4096 Jun 27 21:41 html_ORIGINAL
drwxr-xr-x  3  root            root      4096 Jun 17 19:42 icons
drwxr-xr-x 14 root            root      4096 Jun 17 15:37 manual
drwxr-xr-x  2  webalizer     root      4096 Jun 17 17:24 usage

 

As you can see the html directory has root for user and group. I wanted to change it to webmaster for user and group. To do this, I executed the following command to change the user and group owership of the html directory and its subdirectory (basically, anything in the html directory) This is the first command to change the GROUP OWERSHIP:

 chgrp -R webmaster html

 

And this is the second command to change the USER OWERSHIP:

chown -R webmaster html 



After that, I logged in to my FTP again and was I able to make my File Permission changes to 777. and this is what I wanted to see from the FTP:



site chmod 777 /html/phpmyadmin/config.inc.php
200 SITE CHMOD command successful

Posted on: Jun 27, 2006
Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments