How to Change File Ownership in Mac OS X
Posted by Mike J L dot com [HTML][XML][PERM][FULL] on 23 April 2013, 9:26 pm
How to Change File Ownership in Mac OS X:
User icon Though it’s somewhat rare to encounter ownership and permissions errors in OS X, it can happen, particularly when an account has been moved, or a files owner has been modified by a third party application. Oftentimes you can just run through the process to repair user permissions, but that’s not always guaranteed to sort out a problem, and in some situations you need to adjust a files ownership directly on either a single document or a group of files before the intended user will regain proper access to the file. For these situations, there are two ways to manually change a files ownership, through the Finder and also through the command line. We’ll cover both, though for more advanced users the chown command is really much faster, and in some respects, it’s easier too.

Changing a Files Ownership through Finder in Mac OS X

You can change a files ownership through the same Get Info panel that lets you adjust permissions in the OS X Finder:
  • Select the file in the Finder, then hit Command+i to summon the “Get Info” window
  • Click the arrow alongside “Sharing & Permissions” to reveal the ownership and permissions options
  • Select the lock icon to unlock preferences
  • Click the [+] button to add a new owner, then add the user from the list and choose “Select”
  • Now select the name and click the gear icon, selecting “Make (username) the owner”
Change file ownership in Mac OS X
While going through the Finder is undoubtedly easy, it’s still several steps long and the Terminal can be faster in many ways. Don’t be intimidated by a command prompt, we’ll walk through the process and as you’ll see it’s actually pretty simple.

Change File Ownership with chown from the Command Line

Using the command line is generally considered more advanced, but for some situations it’s not only faster than going through the graphical interface, but in some regards it’s easier too. Here we’ll walk through the basics of changing file owners through the ‘chown’ command, which is standard in Mac OS X and also nearly all variations of unix.
Launch Terminal from /Applications/Utilities/ to get started.
The syntax in it’s simplest form is:
chown [username] [file]
For a usage example, to change the ownership of a file named “test-file.txt” to the user “Bob” the command would be:
chown Bob test-file.txt
Keep in mind that the user name you’re looking to use is the account short name, which is usually what a home directory is named after. If you’re not sure what the short user name is, type ‘whoami’ into the terminal to get the current short name, or type “ls /Users” to see a list of all user accounts on the current Mac.
Change a file owner from the command line with chown
If you’re altering a system files ownership or another users files that you don’t have read and write access to, you can always proceed chown with ‘sudo’ to use chown as super user and force the change:
sudo chown bob ~/Desktop/test-file.txt
Typically you won’t need to change the group of a file, but you can do that with chown as well by appending it to the desired username with a colon like this:
sudo chown bob:staff ~/Desktop/test-file.txt
Again, you usually won’t need to change the files group, though occasionally you will run into a file that has somehow lost or misappropriated both it’s owning user and the access level group it once belonged to.
In OS X, the group is usually either ‘staff’ for general user files that are not admin level, ‘admin’ for administrative level user files like applications, preferences, and connected drives, and ‘wheel’ for superuser access to core OS components like /bin, /library, /home, /etc, /usr/, etc
Anyway, use whichever method is right for your needs, but for almost all cases of adjusting file ownership these days I launch the Terminal and use chown. That’s mostly a matter of preference, but I’ve never been a giant fan of the Get Info panels handling of ownership, though it’s usually fine for making quick adjustments to permissions.



· Older Entries >>

Show: [ALL] [NEWS] [BLOGS] [PODCASTS]

Updated Today:
Bio Break [HTML] [XML] [FULL]
Gamers with Jobs [HTML] [XML] [FULL]
Joystiq MMO [HTML] [XML] [FULL]
Massively [HTML] [XML] [FULL]
MmoQuests.com [HTML] [XML] [FULL]
Mystic Worlds [HTML] [XML] [FULL]
Reign of Gaming [HTML] [XML] [FULL]
The Ancient Gaming Noob [HTML] [XML] [FULL]
The Instance [HTML] [XML] [FULL]
Tobold [HTML] [XML] [FULL]
Welshtroll [HTML] [XML] [FULL]
Write the Game [HTML] [XML] [FULL]
Zen of Design [HTML] [XML] [FULL]
Updated this Week:
A Casual Stroll to Modor [HTML] [XML] [FULL]
BestLeagueBlogNA [HTML] [XML] [FULL]
Blue Kae [HTML] [XML] [FULL]
Cloth 5 [HTML] [XML] [FULL]
DDOcast [HTML] [XML] [FULL]
Game Truth [HTML] [XML] [FULL]
GWJ Conference Call [HTML] [XML] [FULL]
Lineage II [HTML] [XML] [FULL]
MMO Gamer Chick [HTML] [XML] [FULL]
No Prisoners, No Mercy [HTML] [XML] [FULL]
Star Wars: The Blog Republic [HTML] [XML] [FULL]
Updated this Month:
Acid for Blood [HTML] [XML] [FULL]
Elder game [HTML] [XML] [FULL]
Finding Fiero [HTML] [XML] [FULL]
Heartless Gamer [HTML] [XML] [FULL]
kfsone's pittance [HTML] [XML] [FULL]
mmocam! [HTML] [XML] [FULL]
Player Versus Developer [HTML] [XML] [FULL]
Raph Koster [HTML] [XML] [FULL]
Split and Defiled [HTML] [XML] [FULL]
Wondrous Inventions [HTML] [XML] [FULL]