Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-19-2006, 10:38 PM   #1
LQ Newbie
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
How do I make chown unrestricted?


I am running Red Hat Linux Fedora and think I need to change the value
of the POSIX constant _POSIX_CHOWN_RESTRICTED to 0 so that users other
than root can change the owner of files.

I have found many posts that talk around the subject and some say use
this to change it...but whatever the code is doen'yt work, at least not

on the command line.

I am new to Linux and so need it spelling out a bit more clearly :-)

Can someone please explain exactly how to do this?

Thanks, Nick.
Old 09-19-2006, 11:00 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
It might be better (easier?) to allow users to use chown via sudo so that you can restrict who can use it. Have you used sudo before? It's configured with the file /etc/sudoers
Old 09-19-2006, 11:10 PM   #3
LQ Newbie
Registered: Sep 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah i have configured sudo and that does work but that's not really the reason i need it.

I am installing a piece of software that durring the install unpacks files and then attemps to change the owner of them and it is failing here.

Before you sugget it I am installing the software as root but durring the install it "su" to adminuser where adminuser is a user that will become the administrator for the new software. (Don't ask me why!)

So I have tried hacking the install script so that it uses "sudo chown ...." and gave adminuser access to sudo but that hasn't worked.

I would just like to dissable this restricted chown for the install.
Old 09-20-2006, 12:46 AM   #4
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,283

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Originally Posted by bondcaliwood
So I have tried hacking the install script so that it uses "sudo chown ...." and gave adminuser access to sudo but that hasn't worked.
I would hack the script and comment-out the chown entirely. Then go back later and run an equivalent chown manually, as root.

Sounds like a bug in the script to me.
Old 09-20-2006, 02:30 AM   #5
LQ Newbie
Registered: Sep 2006
Posts: 3

Original Poster
Rep: Reputation: 0
After some more debugging of the install script it turns out that the problem is not with the explicit "chown" commands although these would cause problems but it falls over before this on the following tar command.

(cd /tmp/xxinstall/unpack/xxx; /bin/gzip -c -d linux.tgz) | (cd /xxx/mydir/; /bin/tar xfo -)

So it seems that it is trying to change the owner when unpacking the files. Is this normal? How do i control this behaviour.

And still the question is can I change the behaviour of Linux so it allows chown by users other than root??????

Thanks for suggestions so far,

Old 09-20-2006, 07:26 AM   #6
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The cd, gzip and tar commands you posted cannot change file ownership. They do however rely on file/directory access permissions. All they do is unzip/untar an existing file (/tmp/xxinstall/unpack/xxx/linux.tgz) into
a directory called /xxx/mydir.

If you want us to help you debug the script, please post (the relevant piece of) it.

Or alternative, try finding out why the commands you posted fail, starting off by posting the output of
ls -l /tmp/xxinstall/unpack/xxx
ls -ld /xxx/mydir/
Alternatively, you could also try adding 2>/tmp/error.log at the end of the pipe, to get a clue on what goes wrong.


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
How do i add a second hard drive to use for unrestricted file sharing? gizmo911uk Linux - Networking 8 09-12-2005 04:13 AM
Chown -R Jakeh2k1 Linux - General 3 10-31-2004 05:23 PM
Give local computer unrestricted access Boffy Linux - Security 2 08-15-2004 06:23 PM
chown -R ujotne Programming 3 02-25-2004 01:02 PM
chown Sathe Linux - General 13 10-14-2002 12:25 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:55 AM.

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