You then don’t need to acquire elevated privileges using sudo, and can just, for example, There are two main commands to do this in Terminal: chgrp and chown.Ĭhgrp will only change the group, not the owner, and is best used to do that when you, the user, are a member of the original group listed in the permissions. You could perhaps add a new group and remove the old one, but that’s an ungainly way to go about changing owner or group. Check in Terminal what the effect is on permissions, using ls -la, and you’ll see that going beyond the standard owner-group-everyone structure doesn’t alter the basic permissions. You can now try adding another user or group to the permissions in Finder. Select any in the left view and their details, including their ID and, for Groups, the RecordName, are displayed.įor users, we are interested in their UniqueID, which is the user ID I referred to above, and PrimaryGroupID.įor groups, we are interested in their PrimaryGroupID, RecordName, and the list of group members.Ĭompare those lists with that offered by the Finder! In contrast to the Finder, there are dozens that appear listed below. When you’re only visiting to browse lists, don’t authenticate to it, and you won’t be able to mess anything up in its directories.Ĭlick on the Directory Editor, and you can now select in the Viewing popup menu at the top left Users or Groups. ![]() Be careful using this: Apple hides it away because of the dangerous changes which you could inadvertently make with it. Try removing user ID 501 and you will immediately wreak havoc with every file and folder owned by the primary admin user – this is the notorious ‘missing 501’ problem.Īlthough the Finder’s Get Info dialog will display lists of users and groups, they’re incomplete, and the best way to view and study them is in Directory Utility, a tool now hidden away in /System/Library/CoreServices/Applications. Move an external drive to another Mac, and it won’t see the files on there as being owned by username, but by user ID 501. This is important because of the association of that user ID with all your files and folders. When macOS is configured on your Mac, that first admin account is always given the number 501. In this context, you should remember just one number: 501, the number invariably assigned to the primary admin user of every Mac. MacOS, like all breeds of Unix, doesn’t itself work with names for users and groups, but with numbers. ![]() Permissions are granted on the basis of the item’s owner and group, so this short article looks at how you can discover lists of owners and groups, and how to change the owner and group of a file or folder – another basic user skill. ![]() Last week, I looked at changing the permissions of a file or folder, both using the Finder and in the command line.
0 Comments
Leave a Reply. |