chown issue


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users chown issue
# 1  
Old 06-06-2007
chown issue

I have a strange problem in my Linux box (Suse). Recently I took over this box as admin even though I have no prior admin experience. Following is my issue

I had following users under 'root' group initially

user1
user2
user3

Since I did not like user ids under root group. I modifed these user's group to 'users' using

usermod

command. Then I realised that all their files were still under group 'root', so using root id changed their group for all the files recursively using

chgrp -R users <home>

Then after some time, users complained that they could not able to change ower of the files. But claimed they could able to chown earlier

user3 tried the following

$ chown user1 test.sh

and getting the following error

> chown user1 test.sh
chown: changing ownership of `test.sh': Operation not permitted

file test.sh is owned by user3 and under users group

-rwxrwxrwx 1 user3 users 36 2007-05-16 17:50 test.sh

But it is working under root id (I know it should)

Then I changed the group back to root using

> id
uid=1010(iriuser3) gid=0(root) groups=0(root)

> id
uid=1008(iriuser1) gid=0(root) groups=0(root)

Even chgrp is nor working. Giving the same error

Please let me know how to resolve this issue
# 2  
Old 06-06-2007
Depending on your operating system, either a use can run chown to give ownership of a file to another user or not. Solaris, for example, does not allow chown to be run by any user except root. HP-UX will allow chown run by any user to actually change ownership of a file to another user. What OS are you running?
# 3  
Old 06-07-2007
Thanks. I am using Suse Linux
# 4  
Old 06-07-2007
Quote:
Originally Posted by blowtorch
Depending on your operating system, either a use can run chown to give ownership of a file to another user or not. Solaris, for example, does not allow chown to be run by any user except root. HP-UX will allow chown run by any user to actually change ownership of a file to another user. What OS are you running?
On Solaris this behavior is tunable on a global basis via the rstchown parameter. HP-UX allows a more fine level of control via the setprivgrp facility.
# 5  
Old 06-07-2007
Quote:
Originally Posted by Perderabo
On Solaris this behavior is tunable on a global basis via the rstchown parameter. HP-UX allows a more fine level of control via the setprivgrp facility.
What about Linux? I am using Suse Linux
# 6  
Old 06-07-2007
Quote:
Originally Posted by praveenkumar_l
What about Linux? I am using Suse Linux
Depends on the release. Linux is moving toward capabilities with chown controlled by CAP_CHOWN. See:
http://www.die.net/doc/linux/man/man...ilities.7.html
http://www.securityfocus.com/infocus/1400
# 7  
Old 06-07-2007
Thanks Perderabo. By the way, what is the effect of creating a user id (say user1) with uid=0 (that of root)? Will it cause any issues or system crash?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using chown command.

I am working on a test machine. I just discovered that I have misunderstood the way the following command is run. chown -Rv some_user:users /some_folder/*This command do exactly what I want. Change the owner of every things from the named folder and in all child folders. But of course it leave... (13 Replies)
Discussion started by: jcdole
13 Replies

2. UNIX for Dummies Questions & Answers

Pls help. can't do chown ????

I am trying to change the directory to owner of Sybase. But I get permission denied. I did login as root. newd1> ls -l total 58 drwxr-xr-x 2 prod develop 5 Oct 17 06:51 bin drwxr-xr-x 2 prod develop 7 Oct 17 07:18 etc dr-xr-xr-x 1 root root 1... (15 Replies)
Discussion started by: samnyc
15 Replies

3. Solaris

chown

Hello My oracledatabase creats some xmlfiles. this files has the owner hugo. now I've a script (how runs als hugo2) and this script will insert this XMLFile into the database. But that doesn't work, because the owner of the files is wrong, and hugo has not the rights to insert this files into... (3 Replies)
Discussion started by: Street
3 Replies

4. Shell Programming and Scripting

Chown - error

I have a file fin2009_4.txt.gz in the unix ftp server. Owner of the file is: ftpusr. -rw-r--r-- 1 ftpusr sap 0 Feb 19 10:19 fin2009_4.txt.gz When I try to delete this file after copying to my home folder, I am getting the following error. rm: fin2009_4.txt.gz1: override... (4 Replies)
Discussion started by: sid1982
4 Replies

5. AIX

Trouble in chown

I'm a owner of directories or files why I can't deliver the ownership of them up to other users? (1 Reply)
Discussion started by: kang
1 Replies

6. UNIX for Dummies Questions & Answers

chown

is there a difference in chown on a file or a directory? how do i chown a directory and all the contents? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

7. UNIX for Dummies Questions & Answers

reg chown

hi i wrote a script to run 'C' executable which will create a new file, after that util is completed, i have to change the file ownership to some other user. for that i used "chown" for changing the file permission in Korn script :confused:but it is throwing error is "operation... (2 Replies)
Discussion started by: ilayans
2 Replies

8. UNIX for Dummies Questions & Answers

Chgrp and Chown ???

Hi Can anybody please let me know the usage of Chgrp command with an example??? Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

9. AIX

chown

hello chown not change ownership before: 205:system ~kuku chown kuku:system ~kuku after no change 205:system ~kuku aix box can someone help me? ariec (2 Replies)
Discussion started by: ariec
2 Replies

10. UNIX for Dummies Questions & Answers

chown and NIS

I have a box that people are using to ssh to our customer sites. Everyone uses an NIS account that I have created for them. I also create home directories for these users as well on this box. My question is can use a command, like chown, to change ownership of the directories I create to the... (2 Replies)
Discussion started by: Jody
2 Replies
Login or Register to Ask a Question