LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 02-06-2007, 12:20 AM   #1
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 10.04, Crunchbang Statler
Posts: 3,325

Rep: Reputation: 168Reputation: 168
chown problem


For some reason, I often run into the problem that I can not change the group for a directory. Can somebody explain why I (as owner and member of the group develop) can not change the group for a directory using chown or chgrp.

Code:
wim@btd-techweb01:~/tacinc/web$ ls -ld ~
drwx--x--x  20 wim users 1688 2007-02-05 16:32 /home/wim/
wim@btd-techweb01:~/tacinc/web$ ls -ld ~/tacinc
drwxr-xr-x  4 wim develop 96 2007-01-18 12:41 /home/wim/tacinc/
wim@btd-techweb01:~/tacinc/web$ ls -ld ~/tacinc/web
drwxr-xr-x  4 wim develop 1128 2007-02-06 07:04 /home/wim/tacinc/web/
wim@btd-techweb01:~/tacinc/web$ ls -ld ~/tacinc/web/files
drwxr-xr-x  2 wim develop 48 2007-02-06 07:04 /home/wim/tacinc/web/files/
wim@btd-techweb01:~/tacinc/web$ chgrp nobody files
chgrp: changing group of `files': Operation not permitted
wim@btd-techweb01:~/tacinc/web$
Both chgrp and chown result in 'operation not permitted'.

Above listing comes from a Slackware 10.1 box and the directory files is empty.
 
Old 02-06-2007, 12:41 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,558

Rep: Reputation: 80
You cannot change a file or directory's group ownership to a group you do not belong to. You are a member of the develop group but not the nobody group I assume.
 
Old 02-06-2007, 01:05 AM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 58
You cannot use that command as a user.
 
Old 02-06-2007, 01:30 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,558

Rep: Reputation: 80
Actually chgrp works fine as a normal superuser, but you have to be a member of the target group. In addition chown will allow you ro change the group as a normal user, but not the file's owner (only root can do that on Linux -- some *nix systems do allow chowns by a normal user).
 
Old 02-06-2007, 01:37 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 10.04, Crunchbang Statler
Posts: 3,325

Original Poster
Rep: Reputation: 168Reputation: 168
@btmiller,
That makes sense. I changed it as root to group 'nobody' and next changed it back (as wim) to group 'develop'. As I'm indeed not a member of nobody, you are right

@Junior
I can run that command as user (see reply to btmiller)

Thanks both for the thoughts.

Last edited by Wim Sturkenboom; 02-06-2007 at 01:40 AM.
 
Old 02-06-2007, 01:38 AM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 58
Thanks btmiller

Does the (~) before the prompt signify superuser?

Sorry, dumb question, probably still symbolizes home wether in /home or /root

I have little network/multi-user knowledge, hope it does'nt show

Last edited by Junior Hacker; 02-06-2007 at 03:00 AM.
 
Old 02-06-2007, 01:41 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 10.04, Crunchbang Statler
Posts: 3,325

Original Poster
Rep: Reputation: 168Reputation: 168
No, it's a shortcut for the user's home directory.
 
Old 02-06-2007, 03:18 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 59
In normal situation:
~user/ = user's home directory (typically /home/user for regular users)
~/ = your home directory (whichever user you are) = $HOME
 
  


Reply

Tags
chgrp, chown, permission


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chown lsu420luv Linux - Newbie 3 04-18-2006 06:08 PM
Problem with chown fgagnon Linux - General 9 04-03-2005 10:35 PM
chown problem rafc Linux - Newbie 6 07-06-2004 12:18 AM
I Have a problem with the CHOWN command AnnePeter Linux - Software 5 03-12-2004 08:37 AM
chown problem Ayesha Linux - Newbie 4 04-17-2002 10:38 PM


All times are GMT -5. The time now is 10:17 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration