|
|
How To Change User Of A File Or Directory? - Is it possible for admin? | ||
Discussion by Vyoma with 7 Replies.
Last Update: June 2, 2011, 3:48 pm | |||
Is it possible for admin?
The problem at hand can be summarized something like this.
Say there is a directory and there are files in them:
dir1
+---file1
+---file2
dir2
+---file3
+---file4
dir1, file1, and file2 is owned by 'userx'.
dir2, file3, and file4 is owned by 'usery'.
Is it possible for 'userx' to change the ownership of dir2, file3, file4 to his own?
OR
Is is possible for 'usery' to change the ownership of dir2, file3, file4 to 'userx'?
OR
Is is possible for admin to change the ownership of dir2, file3, file4 to 'userx'?
If there is any possibility, could you please give me those commands, and any links to the documentation?
Wed Jan 11, 2006 Reply New Discussion
just type "man chmod" if you want to have more info.
If you want your files belonging both to the oracle user and to the dba group, you type :
chown -R oracle.dba dir2 # -R means recursively, oracle.dba means "user oracle and group dba".
justy type "ls -lR dir2 " in order to see that everything is like you want.
Be careful, if you are not root, this will be a suicide : the files will belong to oracle, and not any more to you, so you will not be able to modify or delete them.
Tell us if you need more help.
Regards
Yordan
Wed Jan 11, 2006 Reply New Discussion
The real problem is that in order to changed the permissions or ownership of a file, you have to be the owner. Even if the file already has the permission of 777, you cannot change the owner. Since we can't log in as the server, we need to write or use a script that will instruct the server to change the file attributes.
I use the Bharat's (Gallery) Cleanup Script to change the files to 777 so I can modify or delete them. This way, you can create a copy of the file which will be owned by you then delete the original. I've had a lot of trouble and no success in attempting to actually change the file's ownership.
If anyone fids a better way to deal with files that are owned the the server (user 0) let me know.
vujsa
Wed Jan 11, 2006 Reply New Discussion
yordan, thanks. What you said worked. Thank you very much.
Moderators, you may close this topic.
Thu Jan 12, 2006 Reply New Discussion
QUOTE
yordan, thanks. What you said worked.You're welcome, Vyoma. Glad to have been helpful.
Yordan
Thu Jan 12, 2006 Reply New Discussion
Thu May 3, 2007 Reply New Discussion
Thu Jun 2, 2011 Reply New Discussion
How To Run A Webserver On Darwin ? (12)
|
(2) Visual Cheat Sheet - Unix
|
Index




