-   Linux - General (
-   -   preserve the ownership (

juno 01-08-2003 01:14 AM

preserve the ownership
After the user zip the file , then the owner of the zip file will be changed , how to preserve the owership ? thx

host//tmp> ll abc.prn
-rwxrwxrwx userA abc.prn
host//tmp> whoami
host//tmp> userB
host//tmp> gzip abc.prn
gzip: abc.prn: Operation not permitted
host//tmp> ll abc.prn*
host//tmp> -rwxrwxrwx userA abc.prn
-rwxrwxrwx userB abc.prn.gz
How to let the owner of the file "abc.prn.gz" is userA (except change it by root) ? thx

DavidPhillips 01-08-2003 01:42 AM

change it with

chown userA.userA filename

juno 01-08-2003 08:48 PM

I can do it at UNIX , but fail in Linux , the error is "chown: changing ownership of `./abc.prn': Operation not permitted" , all users is the same result, can suggest how to make it? thx.

stickman 01-08-2003 09:08 PM

Does userB have permission to write to the directory where the file is?

juno 01-08-2003 09:19 PM

Yes , the path is released to all users, the mode is 666 .

DavidPhillips 01-08-2003 11:01 PM

you need to be root

All times are GMT -5. The time now is 01:19 PM.