LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2019, 10:41 PM   #1
sunilstha108
LQ Newbie
 
Registered: Oct 2019
Posts: 1

Rep: Reputation: Disabled
Question Change File Ownership


I understand that to change the file ownership you either have to be a root or a file owner, is there any way for other users to change the file ownership?
 
Old 10-29-2019, 11:52 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Welcome to LQ
Quote:
Originally Posted by sunilstha108 View Post
I understand that to change the file ownership you either have to be a root or a file owner, is there any way for other users to change the file ownership?
No, and even the file owner can't change the ownership of a file they own to another user.

Play with it. Create a file then try to chown it to another user.
Become the other user, try to chown a file that's not yours to you.

Last edited by scasey; 10-30-2019 at 12:43 PM. Reason: fix typo
 
1 members found this post helpful.
Old 10-30-2019, 12:14 AM   #3
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,808
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
scasey provided the correct answer, "no", but OP might wish to read http://wiki.linuxquestions.org/wiki/Permissions and http://wiki.linuxquestions.org/wiki/Permissions with a focus on "group", which might address a reason why OP asked his question.
 
1 members found this post helpful.
Old 10-30-2019, 11:41 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
If you could do it, that would make file ownership useless — anyone could get at another users data! You have to remember that Linux imitates all the features of Unix, which was written for mainframes, and it's the chief operating system used on servers. That means that privacy on multi-user systems has always been built-in and important.
 
Old 10-31-2019, 12:31 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Modern *nix means a file owner can't give away ownership (except root ofc), but it wasn't always so
Quote:
In earlier versions of UNIX, all users could run the chown command to change the ownership of a file that they owned to that of any other user on the system. This let them "give away" a file. The feature made sharing files back and forth possible, and allowed a user to turn over project directories to someone else.
continued here http://web.deu.edu.tr/doc/oreily/net...is/ch05_07.htm
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux:Copy, change permissions and ownership of a file in a command LXer Syndicated Linux News 0 03-15-2016 04:40 AM
[SOLVED] Linux Mint 15 xfce 32bit grub error+won't change file permissions or ownership bta Linux - Newbie 9 07-28-2014 02:11 AM
Root ownership vs wheel ownership StupidNewbie Linux - Security 2 08-08-2012 12:52 PM
File permission, change ownership revenge80200 Linux - Newbie 2 03-02-2008 01:02 PM
How can an ordinary user change a file's ownership? garymansell Red Hat 1 04-01-2004 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:26 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