chown doesn't work

Hi unix gurus,

I am facing problem with chown command. I am not able to change the owner of any file in my home. It gives error "not owner", though I own the file(as ls shows). What could be the reason? Is it possible that usage chown can be disabled for users.

$
$ ls -l
total 2
-rwxrwxrwx 1 ashishp cluser 21 Mar 3 11:34 test
$ id
uid=61151(ashishp) gid=101(cluser)
$ chown ajaygo test
chown: test: Not owner
$

I am using solaris.

Thanks in advance,
-Ashish

check whether

set rstchown = 1

is included in /etc/system file

it would restrict owner's to change file permissions

There is no mention of rstchown in /etc/system file.

Hi madhan,

I am using HP-UX ,
whats the corresponding file for /etc/system in my machine, its not there.

Thanks,
Gaurav

i am not cent percent sure abt this,

in HP you can use setprivgrp command to restrict owner ( except root ) or group to the usage of chown command

Thanks madhan, I will look into the man pages,

Regards,
Gaurav

Shriashishpatil, check the ownership and permissions of the directory the file is in. Post the output.

Hi,

I was going through the chain. I too face the same problem. I use a Solaris9 SPARC server. I have the /etc/system file, but I do not have any rstchown entry in that file. Why is it still giving me problems?

Thanks.

If rstchown isn't set in your /etc/system, then it's taking the default of rstchown - there are many parameters that can be set in /etc/system - the defaults are taken if no entry is in /etc/system. Find out what the default is, and then you know what you may or may not have to change. Changes to /etc/system require a reboot. May I also suggest that if you do make changes to /etc/system, you make a backup copy of the /etc/system that did work (allowed you to boot) so that when you start making your changes and the server won't boot at all, you can revert back to the good one by booting with the -a option (which asks questions such as what system file it should use) - once booted from the 'good' backup system file, you can fix your mistakes in the 'bad' /etc/system and boot again.

See rstchown

And I would suggest if it isn't set in your /etc/system, that you look at permissions on the directory (and start a new thread instead of taking over someone else's).

RTM,

following are my directory permissions. The directory is in my home area. I can create directory/file and can delete them too.

$ ls -ld dummy
drwxr-xr-x 2 ashishp cluser 96 Mar 3 11:34 dummy/
$

-Ashish

The chown man page states that POSIX_CHOWN_RESTRICTED is enabled by default - this means if you want to change the option, you would have to add set rstchown = 0 to /etc/system and reboot.