LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-08-2003, 01:14 AM   #1
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Rep: Reputation: 15
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
 
Old 01-08-2003, 01:42 AM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
change it with
Code:
chown userA.userA filename
 
Old 01-08-2003, 08:48 PM   #3
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Original Poster
Rep: Reputation: 15
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.
 
Old 01-08-2003, 09:08 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Does userB have permission to write to the directory where the file is?
 
Old 01-08-2003, 09:19 PM   #5
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Original Poster
Rep: Reputation: 15
Yes , the path is released to all users, the mode is 666 .
 
Old 01-08-2003, 11:01 PM   #6
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
you need to be root
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
preserve file ownership with the "zip" command? zovres Linux - General 2 11-25-2004 09:01 PM
I want to preserve a pid linuxprogrammer Linux - Newbie 4 07-23-2004 09:55 AM
preserve links jmr71769 Debian 2 04-22-2004 10:01 AM
Why doesn't "cp -p <file>" copy <file> and preserve ownership? davidas Linux - Newbie 5 04-12-2004 05:44 AM
Preserve the ownership juno Linux - General 1 01-16-2003 01:38 PM


All times are GMT -5. The time now is 03:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration