Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Change ownership of home directory
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Ember1205" data-source="post: 1785072" data-attributes="member: 374272"><p>Ownership of a file or directory is based on the UID of the user. All UID's are "local" to the machine, even for network users.</p><p></p><p>So, the first thing you need to do is to understand how your network users will be representing themselves to the local machine. For example: When I share directories on my Linux machines, I use SAMBA. And, as part of SAMBA, I "map" usernames in the SAMBA software to usernames on the local machine. The local username has an associated UID with it, and THAT'S the UID that I have to ensure owns their home directory. </p><p></p><p>Also, it's pretty important to ensure that UID's stay consistent across various machines on a network so that you always use the same UID no matter where you are. That way, if drives are moved around or sharing changes, the numbers remain the same and so does the ownership.</p><p></p><p>When changing ownership, you use the CLI utility "chown". It supports a username as a parameter, but can also take the UID directly. Use either "chown rsmith" or "chown 1029" or whatever the name or UID is.</p><p></p><p>You should also be looking to do a recursive ownership change all the way down the tree, so the -R parameter probably makes sense. If default group membership will be different, then you should look to whether or not changing that would be necessary.</p><p></p><p>If you're purely transferring ownership of the directory structure from old id to new id, there is no need to copy or to delete. If the username is changing, consider updating the record for the user so that things like ~/<user> will work properly.</p></blockquote><p></p>
[QUOTE="Ember1205, post: 1785072, member: 374272"] Ownership of a file or directory is based on the UID of the user. All UID's are "local" to the machine, even for network users. So, the first thing you need to do is to understand how your network users will be representing themselves to the local machine. For example: When I share directories on my Linux machines, I use SAMBA. And, as part of SAMBA, I "map" usernames in the SAMBA software to usernames on the local machine. The local username has an associated UID with it, and THAT'S the UID that I have to ensure owns their home directory. Also, it's pretty important to ensure that UID's stay consistent across various machines on a network so that you always use the same UID no matter where you are. That way, if drives are moved around or sharing changes, the numbers remain the same and so does the ownership. When changing ownership, you use the CLI utility "chown". It supports a username as a parameter, but can also take the UID directly. Use either "chown rsmith" or "chown 1029" or whatever the name or UID is. You should also be looking to do a recursive ownership change all the way down the tree, so the -R parameter probably makes sense. If default group membership will be different, then you should look to whether or not changing that would be necessary. If you're purely transferring ownership of the directory structure from old id to new id, there is no need to copy or to delete. If the username is changing, consider updating the record for the user so that things like ~/<user> will work properly. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Change ownership of home directory
Top