LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Closed Thread
  Search this Thread
Old 06-12-2015, 02:58 AM   #1
somorg
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Question 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:24 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
That's because /doc has read,write,exec permissions for other user. So vim creates a new file with user2 owner.
 
Old 06-13-2015, 02:33 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Triple duplicate post. Closed. Don't ever do that again.
 
  


Closed Thread


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 Off
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 of owner and group owner of a file belongs to diff user ? somorg Linux - General 2 06-12-2015 10:40 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 - Security

All times are GMT -5. The time now is 07:22 AM.

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