Is there a way to (temporarily) view another user's file on OS X other than to change the permissions of the file? I'd like the OS to ask for the user name/password.

I guess what I'm looking for is something like Window's idea of running Windows Explorer as another user (ideally at file/directory level only). The ssh idea fails because the Finder cannot recognize the permission granted.

An absolute requirement is not to move the user's files.

  • Why couldn't you just log in as the user that owns the files? – CoffeeRain May 31 '12 at 13:17
  • 4
    @CoffeeRain I need access to the two accounts simultaneously. – John Smith May 31 '12 at 14:58

To view the file in Finder (GUI)

NOTE: You're not viewing as the other user - but you're still viewing. Admin rights are required, and the other user's password is not.
This was tested on Mac OS X 10.10 and 10.11 (see below)

  1. Right-click on the folder you want to see (In Finder)
  2. Click Get Info in the drop-down list that occurs
  3. Click the lock in the bottom-right corner
  4. Authenticate
  5. Under Sharing and Permissions click +
  6. Add your own username (or a group, like Administrators) with Read (or Read/Write) permissions
  7. Click the lock to prevent further changes
  8. Your done! You should be able to view the folder in Finder.

Edit for OSX El Capitan and later (10.11)

Although this method still works, the change to El Capitan introduces a default of "rootless" mode. (actually the real name is System Integrity Protection; SIP) There are certain files that cannot be accessed modified by any user, any way in this mode. SIP can be disabled if you need to modify these files, (not just view them) and how to do that is outlined here. (If you only need to see them, you shouldn't have to disable SIP)

To view as another user in Terminal

Note: This requires you to either have admin rights or the other user's password. It only works from the terminal, while the session is active.

  1. Type su - otherusername into the terminal. Replace otherusername with the other user's name. If you have admin rights, you can type sudo su - otherusername to use your password instead of the other user's. You are now logged into the terminal as them. If you just want to log in as root with full access, type sudo su, and enter your (admin) password.
  2. Change directory to the directory that you'd like to view (/edit). cd /Users/UserDirectory/subdirectory
  3. You can now view the files

EDITED to match edited requirements.

You can achieve exactly what you want by creating a Shared folder. To do so go to System Preferences > Sharing > File Sharing and Add all the folders you want to share.

You can do this, too, by directly selecting a folder in the Finder,, choosing Get Info from the File menu, and enable Shared Folder to share it (or deselect "Shared Folder" to stop sharing the folder).

Extracted from Apple's 101: File Sharing.

You can achieve this in a couple of ways.

Logging as root will grant you read and write privileges to all areas of the file system. You'll need to have the root user enabled. To do so, assuming you're using Lion:

  1. Go to System Prefereces > Accounts.
  2. Click the lock and authenticate with an administrator account.
  3. Click Login Options.
  4. Click the Edit or Join button at the bottom right.
  5. Open Directory Utility.
  6. Authenticate with an administration account.
  7. Choose Enable Root User from the Edit menu.
  8. Enter the root password.

Here is described for earlier OS.

Placing the file under the Shared Folder (/Users/Shared), or Sharing the folder, the one where the file you want to edit is, will grant other users access to that file. More about it, and how to Share other folders here.

  • I'm familiar with both those methods. The first method does not let Finder open the file/directory. Sure it works on the command line but you cannot edit excel files there. The second method is destructive in the sense that the user has to move his files to a particular place. – John Smith May 31 '12 at 10:15
  • Enabling the root user is not necessary and usually a bad idea. You can achieve the same end more safely using su and sudo. At your shell prompt su - <administratorname> this will prompt for the admin password and you will become the admin user. From here you can use sudo on any command to achieve root access for that command only e.g sudo ls /Users/<otheruser>. If you need to interact with applications and files from the other user account then use open <filename> or open -A <appname> from the shell to launch from admin account – Kevin May 31 '12 at 10:16
  • I ment logging as root, not through terminal but with the logging screen. Chanching user. And for the sharing folder, i'll edit my answer, as I was not clear enough. – Thecafremo May 31 '12 at 10:34
  • @Kevin Tried with iTunes, failed with : LSOpenURLsWithRole() failed for the application /Applications/iTunes.app with error -10810. – John Smith May 31 '12 at 17:42

An easier method is to use root privileges or just impersonate the user. Open up a terminal and do man su and man sudo for more information.

You must log in to answer this question.

protected by bmike Oct 16 at 17:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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