LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chown command (https://www.linuxquestions.org/questions/linux-newbie-8/chown-command-832353/)

anubhav914 09-15-2010 11:38 AM

chown command
 
i am apps-owner of a particular folder.

drwxrwxr_x 5 apps gen 4096 imgp1

now i want to change its group to apps.
i give command as

chgrp apps imgp1

but it says operation not permitted.

also chown gen imgp1 is not permitted.
who are allowed to give these commands

divyashree 09-15-2010 11:46 AM

Quote:

Originally Posted by anubhav914 (Post 4098413)
i am apps-owner of a particular folder.

drwxrwxr_x 5 apps gen 4096 imgp1

now i want to change its group to apps.
i give command as

chgrp apps imgp1

but it says operation not permitted.

also chown gen imgp1 is not permitted.
who are allowed to give these commands


Only root and the owner of the file is allowed to change the group ownerships. You must be root to run this command successfully.

TB0ne 09-15-2010 11:48 AM

Quote:

Originally Posted by anubhav914 (Post 4098413)
i am apps-owner of a particular folder.
drwxrwxr_x 5 apps gen 4096 imgp1

now i want to change its group to apps.
i give command as

chgrp apps imgp1

but it says operation not permitted.

also chown gen imgp1 is not permitted.
who are allowed to give these commands

The owner of the folder is allowed to. So unless you're logged in as user "apps" in this case, those commands won't work. You might also want to check the rights on the folder above the "imgp1" folder.

Best thing to do would be to issue the command as "sudo <command name>"

crahuldba@gmail.com 09-15-2010 11:50 AM

hello
If you are a nonroot user you can change only that group to which you belong . I mean you are user apps. fire following command
groups
above command show the group or groups name to which you belong.

TB0ne 09-15-2010 12:39 PM

Quote:

Originally Posted by divyashree (Post 4098426)
Only root is allowed to change the group ownerships. You must be root to run this command successfully.

Incorrect. The OWNER of a file may change the group of any file, providing they're a member of the group they're trying to change.

If a user belongs to "users, staff, video, cdrom", they can then change group ownership of a file/directory to be any one of those. Any group they don't belong to, needs root access.


All times are GMT -5. The time now is 05:22 PM.