LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2010, 12:38 PM   #1
anubhav914
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
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
 
Old 09-15-2010, 12:46 PM   #2
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,362

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by anubhav914 View Post
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.

Last edited by divyashree; 09-16-2010 at 11:16 AM.
 
Old 09-15-2010, 12:48 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,915

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by anubhav914 View Post
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>"
 
Old 09-15-2010, 12:50 PM   #4
crahuldba@gmail.com
Member
 
Registered: Apr 2010
Posts: 51

Rep: Reputation: 2
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.
 
Old 09-15-2010, 01:39 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,915

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by divyashree View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chown command tommytomato Linux - Newbie 3 03-17-2010 09:08 AM
How to use the chown command cbjhawks Linux - Newbie 2 01-12-2010 11:10 AM
Help with chown command brokenpromises Linux - Newbie 2 09-05-2007 04:24 AM
So... I used Chown command and screwed my pc... Nosram Linux - Newbie 3 01-20-2004 07:09 AM
chown command help ksgill Linux - Newbie 9 04-28-2003 11:52 PM


All times are GMT -5. The time now is 04:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration