How to: Password Protect a Folder on MacOS

If you want to lock a folder on a Mac (macOS and OS X), you can achieve that by creating an encrypted image and then mount the folder as a virtual drive. Whenever you open that encrypted image file, macOS (or OS X) will ask you to type a password to mount the image. You can also protect files and folders from changes and deletion. Here is how to do that.

Create a Password-protected Image

Note: This method for locking folders on Mac works on macOS and OS X (back to OS X 10.6 Snow Leopard).

  1. Launch Disk Utility
    1. Go to Applications folder (Click Go on the Mac menu bar and choose Applications, or Press Command + Shift + A).
    2. Open the Utilities folder.
    3. Double-click on Disk Utility.
  2. Click on File from the Disk Utility, select New Image and click on Image from Folder.
  3. Select the folder you want to lock, and click Open (or Image).
  4. Now, name your image file, and choose the location to save it.
  5. In the Encryption field, choose 128bit or 256bit encryption.
  6. When prompted, type your password of choice and click Choose to confirm.
  7. In the Image Format field, choose the type of file. (Choose “read/write” if you want to create an editable file, or choose another format for a non-editable.)
  8. Once you finish with the adjustments, click Save.
  9. Now, a password-protected .dmg file will be created in the file location you’ve chosen.

To access your protected .dmg file, double-click on it to mount it in Finder. Now, type the password you’ve set. After the .dmg file is mounted, you can access its content as a regular folder. Just like in any folder you can add files to the password-protected image. Once you are done with it, eject it (right-click on it and choose Eject).

Now, when you have your content secure in your password-protected image, you can delete the old folder. But make sure you DO NOT delete the .dmg file.

To increase the protection for this file, you can prevent it from changing and deleting.

Prevent Files from Changes and Deletion

Note: Keep in mind that this method does NOT lock the content of the file or folder. It only prevents the locked folder from deleting. You can achieve that only using the previous method.

  1. Choose the file or folder you want to prevent from deletion from the Finder.
  2. Click File on the Finder menu and choose Get Info (or press Command + i).
  3. In the General section tick the boxLocked.” This will lock (prevent from deleting or changing) the file.
  4. Close the window when finished.
  5. Now, if you try to delete the protected file, it will prompt you with a window telling you that the item is locked.
Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to: Password Protect a Folder on MacOS

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested