3

I'm trying to build a portable user and one of the ways I was thinking of doing is through a symlink in /Users that will point to external flash drive.

If I have two machines and I make a user with a same username, are those users the same when it comes to encoding permissions and owner information of the files?

If not, does anyone have any pointers or ideas on how else I can do it? Maybe there is a way recreate/migrate existing user to another machine and basically replicating possible IDs used by the system to check permissions.

5
  • 1
    If you right click on a user in the Users section of System Preferences, you can change where the user's directory is. I'd rather do that than mess with symlinks. Aug 12, 2020 at 5:33
  • Which filesystem do you use on the flash drive?
    – nohillside
    Aug 12, 2020 at 6:52
  • I'd put whatever supports encryption. Nowdays APFS is standards, so preferably that one
    – Hedrack
    Aug 12, 2020 at 7:06
  • 1
    Does this answer your question? Move macos user home folders on external drive. The second answer elaborates on At0mic's comment and provides some links with more information.
    – jaume
    Aug 12, 2020 at 7:27
  • It doesnt. My question is not how to move the user. Its how the permissions work if I want to use that user on multiple machines
    – Hedrack
    Aug 12, 2020 at 7:41

2 Answers 2

5

No, the name is not the crucial factor. Each user account has an ID number (UID). The first-created user account is normally number 501, then next is 502, etc.

If Mac1 has account called "Dave", but has a UID of 502, then files saved on that Mac will be considered a different user account when used on account "Dave" #501 on Mac2. This will cause problems with file ownership and read/write access.

Also, bear in mind that if the OS can't find the user folder at boot, it will recreate a new empty account with that name in the default location.

(If you're looking to sync files between two different Macs, there are better ways of doing it.)

2
  • What would you recommend to use as a sync tool across the entire user, not just several folders?
    – Hedrack
    Aug 12, 2020 at 9:15
  • I use Resilio Sync. It does "real-time" syncing, so it copies files in response to changes, not just every 30 mins or whatever. There are many others. However, I don't copy the user Library. Firstly, some data in the user Library may be machine-specific, such as Caches, window positions, etc. And I may well want different prefs on two separate Macs. Also, different OS versions will read/write different data to the user Library.
    – benwiggy
    Aug 12, 2020 at 10:18
2

The answer is in general no. The usernames themselves are not used by the system for encoding permissions and ownership information. Instead each user is identified by a numeric ID number - and this is used when encoding permissions and ownership information on disk. A seperate translation step converts the ID to a username for display.

If you "naively" move across files from one computer to another - keeping the ID numbers the same - then it could be that it would be translated to different user names on the other computer. It all depends on the order the users are created in, so even if you have the same usernames on both computers - the IDs could be different.

Usually you would ensure a global view of usernames/IDs across computers by joining them to some kind of directory. This is what is normally used in office setups, where you have a server with Apple's Open Directory, Microsoft's Active Directory, or similar LDAP service.

You can explore your own setup by opening the "Directory Utility" app on the Mac. In the "Directory Editor" tab, you'll be able to search for usernames and see in which directory they're stored (for example /Local/Default) and which attributes are stored about them. In particular look at the one called "UniqueID", which is the user's actual ID used for storing permissons and ownership information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .