[SOLVED] How to change the ownership of a directory ?
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been dealing with ACLs and stuck with this problem. I have a directory which is copied from user machine to the Uinx server. So, the user is the owner of the directory. Now, in order to compile the files, I have to change the ownership of this directory to the admin account and also inherit the permissions to the subdirectories.
admin as in root?
there are a few things that can prevent even root from modifying a file.
on linux, that is. i know nothing of solaris.
e.g. it could have the immutable attribute set, can be changed with 'chattr -i' iirc.
also, what are the actual ownership & permission of the file right now, and is "the admin" uid=0?
Does none of what you've already been told about ACL's and permissions apply here? You've opened several threads in the past about permissions/ACL's, so it's surprising you're opening another, given the good amount of information you've already been given. You said you've been an administrator for years now, and are working on a doctorate...as such, you should know what kind of information you need to post, and have a REALLY good idea on what you should haven done/tried by now.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
I have been dealing with ACLs and stuck with this problem.
Are ACLs involved here?
Did you set ACLs?
Do you see ACLs?
Quote:
I have a directory which is copied from user machine to the Uinx server.
What is the source machine OS and file system ?
What is the target machine Solaris version and file system ?
How was the directory copied?
Quote:
So, the user is the owner of the directory.
Did you check who own the directory and the files inside it?
Quote:
Now, in order to compile the files, I have to change the ownership of this directory to the admin account and also inherit the permissions to the subdirectories.
What is that "admin" account?
Under what account do you run the failing "chmod" command?
My apologies for not providing the detailed information thought that the provided information was sufficient. Please find the details below:
Quote:
Are ACLs involved here?
Did you set ACLs?
Do you see ACLs?
Yes, ACLs applied here.
ACLs supposed to be inherited from the top-level directory to the newly copied directory.(This could be an issue).
Yes, I see the ACLs.
My apologies for not providing the detailed information thought that the provided information was sufficient. Please find the details below:
You've been told in the past to provide such details, so not sure why you thought omitting them would be a good thing now.
Quote:
Yes, ACLs applied here. ACLs supposed to be inherited from the top-level directory to the newly copied directory.(This could be an issue).
Yes, I see the ACLs.
Yes, the directory and the files are being owned by the user. If you look at the above ACLs user:ax000 is the admin. Usually, "ax000" is the owner of all the files and directories except this copied directory and the directory is being copied from a Windows OS.
(Bold added for emphasis)
And this is another good thing to put in a problem...using Windows adds things into the equation, and the "admin" account now actually makes sense. So have you tried copying the directory on the Solaris box itself, and not through Windows? Tried changing the ownership to something that works with the Windows system? You omit things again, such as the use of Samba (is it being use here?), or how Windows is attached to this Solaris system, or what your actual goals are.
What are you trying to do? Because it doesn't sound like you're having a problem with ACL's, but rather with Windows.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
You still missed to answer to three of my questions:
- What is the source machine OS and file system ? (You just stated Windows.)
- What is the target machine Solaris version and file system ? (I'm assuming Solaris 11.x)
- How was the directory copied?
In any case, the behavior you complain of is expected.
By default and for security reasons, an unprivileged Solaris user cannot give away ownership of a file or a directory.
There are various ways to change this:
grant the required privilege (PRIV_FILE_CHOWN_SELF) to the admin account
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.