this post was submitted on 06 Jul 2023
1 points (100.0% liked)

Linux

47369 readers
984 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Solution

As mentioned by @[email protected], the solution was to add the flag -H to the chown command. For example, to change the ownership recursively down the file linked by a symbolic link, you would do somehting like

$ chown -HR <symbolic-link>

For reference, see the section on -H:

-H if a command line argument is a symbolic link to a directory, traverse it

Edit 1:

Another useful flag is -L:

-L traverse every symbolic link to a directory encountered

Original Post

On a server I have some folder, x, that contains many files. x has a symbolic link y. y is shared over the network via Samba. Some client creates some files with within the shared y folder (the files are then owned as client:client since I don't have a forced user configured in samba). I tried to change the ownership of all of those files on the server by doing # chown -R new_user:new_group y, however the ownership of all the files within x stayed the same. I could only change their ownership if I did not chown across the symbolic link.

I thought chown could follow symbolic links?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here