30

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.

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

3 Answers 3

37

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. You're 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, anyway 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

https://unix.stackexchange.com/questions/3568/how-to-switch-between-users-on-one-terminal
Note: This requires you to either have admin rights or the other user 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
5
  • The issue with giving other users permission to access the folder under GetInfo->Sharing&Permissions is how is the user able to navigate to that folder without also having permissions on the higher-level folders ? There must be a way, but I don't see if off-hand. Jan 24, 2020 at 4:04
  • Was just looking for this capability in order to do some troubleshooting between two accounts on a Sierra machine, both owned by me. Unfortunately you can't just add yourself to the user directory and have it apply below, it's not recursive. So you have to individually select each folder inside the user folder you want access to, and add yourself to those folders. But then you may also have to do it for all sub-folders within those folders. Shame the top level permissions can't just be inherited apparently... =(
    – JVC
    May 25, 2020 at 2:28
  • @JVC I'm on Windows mainly now, so I don't have a mac handy to check, but I thought I remembered there being a checkbox where you could apply settings to child files and folders. You can always use the command line version as well. And if you just want to change the permissions, look up chmod -- that has a recursive option as well.
    – Cullub
    May 26, 2020 at 14:17
  • Yeah I was sure there used to be an option to "apply permissions changes to everything in the folder" or somesuch, but it's not there. Weird. I know I could use command line but basically I'm lazy and this isn't something II need very often (like once a decade) so I thought there was just a simple 2-second solution. Apparently not... but oh well, I'm managing. Thanks!
    – JVC
    May 26, 2020 at 14:20
  • FYI: Just changing the "everyone" user doesn't seem to work Sep 21, 2021 at 13:51
5

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.

4
  • 1
    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, 2012 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, 2012 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, 2012 at 10:34
  • @Kevin Tried with iTunes, failed with : LSOpenURLsWithRole() failed for the application /Applications/iTunes.app with error -10810.
    – John Smith
    May 31, 2012 at 17:42
1

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.

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