cancel
Showing results for 
Search instead for 
Did you mean: 

chown: filename: Not owner

SOLVED
Go to solution
Jose Luis
Advisor

chown: filename: Not owner

Hi everybody,
I have a user count (not root) in a Tru64 5.1a. I wish change the owner to a file (I am the owner) for other user, but the system doesn´t let me.
For example, I am the "mtt" user and I have this file:

-rw-r--r-- 1 mtt mds 0 Aug 14 2003 fileXXX

I wish change the owner for "app", with this command:

# chown app fileXXX
chown: fileXXX: Not owner (this message appear)

Can I change the owner of my files?
Thank's in advance.
Regard
The UNIX world is the tenth planet in the solar system
10 REPLIES
Mobeen_1
Esteemed Contributor

Re: chown: filename: Not owner

Jose,
There was a similar discussion some time back on the HPUX forum, please check the link below and let us know how things shape up

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=234475

regards
Mobeen
Ravi_8
Honored Contributor

Re: chown: filename: Not owner

Hi

check the permission for /sbin/chown it should be like

-rwxr-xr-x 1 bin bin 24800 Oct 17 2002 chown

it shouldn't be having any sticky bit/SUID set.

and also if the file on which you are trying to change owner is on NFS file systems, then you need to change the permission on NFS server
never give up
Michael Schulte zur Sur
Honored Contributor

Re: chown: filename: Not owner

Hi,

I would tend to say no.

greetings,

Michael
Nicolas Dumeige
Esteemed Contributor

Re: chown: filename: Not owner

Hello,

Only root can use the chown command.
On Solaris, it can be modified by adding the following to /etc/system:
set rstchown = 0
Note that this defeats quotas.
I don't know how to modify this with Tru64

Cheers

Nicolas
All different, all Unix
Jose Luis
Advisor

Re: chown: filename: Not owner

Thank's for all your replies.
Answer to Ravi, my file is not a NFS file.
The permissions of the "chown" file are:

-rwxr-xr-x 1 bin bin 24832 /usr/bin/chown

it looks ok. Then apparently only root can use the chown command in T64 systems.
Nicolas, Do you have a documment about this?

Thank's
Regards.
The UNIX world is the tenth planet in the solar system
Nicolas Dumeige
Esteemed Contributor
Solution

Re: chown: filename: Not owner

Sorry Jose Luis,

It seems there is no such equivalent on Tru64 :
http://www.blacksheepnetworks.com/security/resources/tru64/2834.html

Anyway, an idea of workaround :
- encapsulate the chown in a script
- make the script suid as root (chmod 4755)
- put the script earlier in the PATH of all user, or pick another name

REM 1 : You can log the user who use it if you think that you've open a security hole.

REM2 : any modification on the script will remove the suid bit.

Nicolas
All different, all Unix
Ann Majeske
Honored Contributor

Re: chown: filename: Not owner

setuid scripts are a really bad idea and not supported on Tru64 UNIX. They can open very large security holes on your system.

A setuid program that executes chown would be OK. A better idea would be to look into using dop (see the Security Manual) or sudo (do a web search on sudo).

Ann
Orrin
Valued Contributor

Re: chown: filename: Not owner

Hi,

That's the way it works... it's to do with the group and everyone access.., not only to the file but to its parent directories as well.

If you just want the user app to get the file use the cp command, to copy the file accross and the file owner will be app.

e.g

-rw-r--r-- 1 mtt mds 0 Aug 14 2003 fileXXX

Login : app
password:XXXXXX

/usr/users/app> cp ../mtt/fileXXX .

/usr/users/app> ls -l fileXXX

-rw-r--r-- 1 app apl 0 May 19 2004 fileXXX

As you can see the only downside is the timestamp changes...

If the timestamp is not relevant, then this is the preferable procedure to using suid to root to make the change.
Hope this helps...

Regards,
Orrin.
Keith Moodie
Occasional Advisor

Re: chown: filename: Not owner


Gidday,

What about ACL's ?

The reason why you can't change a file so that someone else owns it is because they may not want it.
If you no longer want the file, then the approach is for them to copy it, and after they safely have it you delete the original.

However if you want to both have full access to the file, but dont want to do it by setting the group or world permission bits then ACL's (Access Control List's) are the way to go.

However ACL's only work if they have been enabled on your machine.

man acl will tell you more.

Jose Luis
Advisor

Re: chown: filename: Not owner

Thank's to everybody for your Help.
JL
The UNIX world is the tenth planet in the solar system