LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-12-2015, 02:49 AM   #1
somorg
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Lightbulb change of owner and group owner of a file belongs to diff user ?


Can anyone explain ?

Hi,
(Red Hat Linux 7)
#mkdir /doc
#chmod 777 /doc
user1$ cd /doc
user1$ touch file1
{here the owner and group owner of the file is user1}

user2$ cd /doc
user2$ vim file1
{user2 is able to add content and save the file.}

1. After user2 edited the file1 with "vim" the owner of the file get changed why?
2. file1 was created my user1 and having 664 perm by default and user1 is the owner and groupowner of the file. How user2 was able to edit it with the file having only read perm for others ?
 
Old 06-12-2015, 03:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
it depends on the permissions of the directory, not on the file itself (because the permissions on the file will rule the access to the content of the file, and the permissions on the dir will rule the access to the content of the dir, which are the entries, the filenames).
 
1 members found this post helpful.
Old 06-12-2015, 10:40 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://www.linuxquestions.org/questi...er-4175545148/
http://www.linuxquestions.org/questi...er-4175545147/
 
  


Reply



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
change of owner and group owner of a file belongs to diff user ? somorg Linux - Newbie 3 06-14-2015 09:11 AM
change file owner to another owner byran cheung Linux - Newbie 5 12-19-2014 03:14 PM
[SOLVED] Most convenient owner:group owner for directories in /home/regular_user? stf92 Slackware 2 10-26-2014 08:12 AM
Change owner, group and permission settings on file and folder creation?? helptonewbie Linux - Newbie 9 12-17-2007 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:47 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration