In linux I run into the issue of "Oh you formatted this drive and now its root's not yours bwah" and its annoying. How do I fix this?
Specifically, I had a drive set up with all my windows files in it and, Imma be honest, its just being wasted not being XFS. So I pulled what wasn't the exact same as my home drive over and formatted and now its labeled as root's. I also have a partition on my boot drive for video project's that I just noticed is root only.
chown -R aremis /path/to/directory | changes just the owner octect leaving group alone, with the recursive flag. chown -R aremis:aremis /path/to/directory | changes the perms so that armeis and all who belong to group aremis have access. chown -R :aremis /path/to/directory | changes the perms so that any who belong to group aremis have access but does not change who the owner of the file is.
This command:
Would make you the owner, while leaving the group alone, and specifiy the :root is actually redundent and not needed if root is already the owner with group permissions set. It would actually be more preferred for aremis to do a aremis:aremis if he is the only one planning on using the drive.
If we have a standard umask of 022 then the permissions are as follows: 755 7 - owner - r w x 5 - group - r x 5 - world - r x
The user who owns own the file, and can modify it with their octal value, in the above example that means they have read, write, and execute.
Any user who belongs to the same group has the group octal permissions of the file, in the above example, this is read and execute.
Any user who does not belong into either category falls under this. In the above example, this is read and execute.
Often you will find directories as either 755 or 775.
It is quite common on most distributions to create users with a group id akin to their user name. So user aremis belongs to the aremis group, unless there's a sticky-bit somewhere. Any file he makes belongs to aremis and inherits the aremis group perm. If this is not the case, such as in multi-user systems, then for the group it may be something like users, so if we lookup which groups aremis belongs to then we will find that he is aremis and his primary group is users. User aremis can be a member of many supplementary groups as well; such as developer, wheel, admin, sudo, mycustomgroup, etc.
Wonderful description! Thanks for that, hopefully it sheds some light. I usually tend to leave the groups alone, though I also have no idea what his use case quite is, so thank you for adding alt scenarios! Very well organized, too.