1820390 Members
3427 Online
109623 Solutions
New Discussion юеВ

chown : Not owner

 
SOLVED
Go to solution
panchpan
Regular Advisor

chown : Not owner

Hello.

I have two user IDs. user csms and user ftpcsms. csms is normal user ID and ftpcsms is ftponly and belongs to group ftponly. csms also is a part of group ftpcsms. But csms is not able to modify the ownership of a file created by him to ftpcsms.

-r-xr-xr-x 1 bin bin 24576 Nov 14 2000 /usr/bin/chown

All looks good with chown. The error just says 'not owner' ... Any fix of it?

thank you!
16 REPLIES 16
Wim Rombauts
Honored Contributor

Re: chown : Not owner

What file are you truying to change ? Can you list it with ll and show the oputput ?

The "Not owner" message means you cannot change the ownership of a file that is not owned by you. This is a normal message if the file is not yours, that is why Iask for you to list the output of ll here.

Wim Rombauts
Honored Contributor

Re: chown : Not owner

What file are you trying to change ? Can you list it with ll and show the output ?

The "Not owner" message means you cannot change the ownership of a file that is not owned by you. This is a normal message if the file is not yours, that is why Iask for you to list the output of ll here.

Andrew Young_2
Honored Contributor

Re: chown : Not owner

Hi.

I would also look at the permissions of the directory you are in. If the recipient user does not have permissions to that directory chown will fail with the same error.

ls -ld /directory

Regards

Andrew Y
Si hoc legere scis, nimis eruditionis habes
panchpan
Regular Advisor

Re: chown : Not owner

Please see...two users here 'puma' and 'ftprs81'

[2459] cceor10:slr/kkn $ touch iy
[2460] cceor10:slr/kkn $ ll -d iy
-rw-r----- 1 puma MFGPRO 0 Oct 31 08:40 iy
[2461] cceor10:slr/kkn $ chmod 660 iy
[2462] cceor10:slr/kkn $ ll -d iy
-rw-rw---- 1 puma MFGPRO 0 Oct 31 08:40 iy
[2463] cceor10:slr/kkn $ chown ftprs81:ftponly iy
iy: Not owner
[2464] cceor10:slr/kkn $ chown ftprs81 iy
iy: Not owner
[2467] cceor10:slr/kkn $

$id ftprs81
uid=27912(ftprs81) gid=606(ftponly)
$id puma
uid=26793(puma) gid=600(MFGPRO) groups=601(mfgadm),607(socks),606(ftponly)
$who am i
puma
Wim Rombauts
Honored Contributor

Re: chown : Not owner

That is indeed incorrect behaviour.
Maybe we first need to check the basics : What OS version are you running, and what is the output of "swlist -l product | grep chown" ?
panchpan
Regular Advisor

Re: chown : Not owner

Please advice...

pwd
/puma/puma/tmp/slr/kkn
drwxrwxrwx 16 puma MFGPRO 8192 Oct 31 08:40 kkn
drwxrwxrwx 12 puma MFGPRO 8192 Oct 30 19:55 slr
drwxrwxrwx 29 puma MFGPRO 14237696 Oct 31 09:48 tmp
drwxrwxr-x 40 puma MFGPRO 49152 Oct 31 09:48 puma
panchpan
Regular Advisor

Re: chown : Not owner

Hello.

no output came for swlist -l product | grep chown

Version is 11.11

HP-UX cceor10 B.11.11 U 9000/800 3947100180 unlimited-user license
J. Bravo
Respected Contributor

Re: chown : Not owner

Hi!

Could you attach the output of getprivgrp?

Regards;

J. Bravo.
Wim Rombauts
Honored Contributor

Re: chown : Not owner

Still trying to find a clue ...

What is the output of "pwget | grep 26793"
I am looking for a possible duplicate UID.

What if you try the same chown operation on a file in /tmp or /var/tmp ? (Maybe the failure is directory-specific ?)
Dennis Handly
Acclaimed Contributor

Re: chown : Not owner

>Andrew: I would also look at the permissions of the directory you are in. If the recipient user does not have permissions to that directory chown will fail with the same error.

I have never heard of that. Just whether you are owner or not. Or the point J. Bravo is making about getprivgrp. (Or of course a readonly file system.)

You can set your system up so nobody but users having CHOWN can do it:
$ getprivgrp
global privileges: CHOWN

>Wim: what is the output of "swlist -l product | grep chown" ?

This won't work. You need "-l file". And if you know the fileset you can use:
# swlist -l file *.UX2-CORE | fgrep /usr/bin/chown

>J. Bravo: Could you attach the output of getprivgrp?

Exactly.

>Wim: (Maybe the failure is directory-specific?)

That would only be for NFS read only file systems. Which we know is not the case because touch(1) worked.
MarkSyder
Honored Contributor

Re: chown : Not owner

Did the (empty) file iy exist before you touched it, with ownership puma?

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
panchpan
Regular Advisor

Re: chown : Not owner

Hello... The file is newly touched and here is the output :
$ getprivgrp
global privileges:
$

Please advice How to fix it?
Kevin Wright
Honored Contributor
Solution

Re: chown : Not owner

/etc/privgroup is where you can change defaults. remove the file if not using any restrictions, restart with /sbin/init.d/set_prvgrp.

enable global chown (default)
setprivgrp -g CHOWN

for securety requirements though, you may want to restrict who can run chown.

see man setprivgrp for details.
ftpcsms CHOWN
Tim Nelson
Honored Contributor

Re: chown : Not owner

Execute an ls -n on the file so we can see the UID of the file's owner.

Is there a duplicate UID for puma ?

J. Bravo
Respected Contributor

Re: chown : Not owner

Hi!

You need to issue the setprivgrp (or to configure the /etc/privgroup for the users you want to work the chown) with the CHOWN privilige in order to the chmod works again. For my servers, the configuration is the default:

# getprivgrp
global privileges: CHOWN

Regards;

J. Bravo.
panchpan
Regular Advisor

Re: chown : Not owner

Thanks to all for all your help!!!

Have a great weekend.