FaceTime Like A Pro (eBook)

Get our exclusive Ultimate FaceTime Guide 📚 — absolutely FREE when you sign up for our newsletter below.

How to Password Protect a Folder on Mac

Secure folders on Mac with Disk Utility and Terminal. Learn to encrypt, hide, remove passwords, and pick the best protection method.

Key Takeaways:

  • Why protect folders on macOS: Locking sensitive folders prevents snooping on shared Macs, keeps work and personal files private, and limits unwanted sharing through sync.
  • Disk Utility method: Create an encrypted disk image of your folder, choose a password you remember, then mount, move files inside, and eject to lock.
  • Terminal ZIP encryption: Use zip with encryption to wrap a folder into a passworded archive. Quick, scriptable, and opens on macOS without installing extra apps.
  • Third-party apps on Mac: If Terminal feels tedious, apps like Encrypto, Hider Pro, or Privaulty offer simple interfaces for locking folders securely with encryption.
  • Hiding folders vs encryption: chflags hidden only hides items from Finder. Anyone can reveal them. For stronger protection on macOS, encrypt and avoid weak passwords.

Having your important folders password-locked ensures your private and sensitive files are secured from unauthorized access if you often share your Mac with others. But unlike Windows, macOS doesn’t offer a direct “password-protect folder” option. However, a few workarounds that use the built-in Disk Utility and Terminal to protect any folder with a password do exist.  
 
This post details multiple methods to password-protect a folder on your Mac.

Why Password-Protect a Folder on Mac 

Privacy, confidentiality, and security are typically the three main reasons to password-protect folders on a Mac: 

  • Privacy: Keep personal files safe from others using your Mac. 
  • Confidentiality: Protect work documents, financial records, or client files. 
  • Security: Prevent unauthorized access in case your Mac is lost or stolen.

3 Ways to Password-Protect a Folder on Your Mac

There are three ways to password-protect a folder on your Mac: using the Disk Utility app, via the Terminal window, or through third-party apps.

1. Using Disk Utility

You can use the Disk Utility tool on your Mac to create a disk image of the folder you want to password-protect. 
 
For those unaware, a disk image is a special file (with the .dmg extension), that acts like a virtual hard drive. When you double-click to open it, you’re required to enter the password. Once done, it mounts on your desktop like an external drive, giving you access to its content. When you eject the drive, the files inside become invisible, and anyone attempting to open it must enter the password. 
 
With that said, here’s how you can create a disk image of a folder using Disk Utility on your Mac:

FaceTime Like a Pro:

Get our exclusive Ultimate FaceTime Guide 📚 — absolutely FREE when you sign up for our newsletter below.

  1. Open the Disk Utility app on your Mac. You can do so by heading to FinderApplications or using the Spotlight search.
  2. Now, click on File in the top menu bar. 
  3. Next, in the drop-down menu, select New ImageImage from Folder
    Go to file new image
  4. Then, select the folder you wish to create the disk image of.
    Select the folder and click choose
  5. In the dialog box: 
    • Name your new disk image. 
    • Choose a location to save it.
      Select file name and location
    • Under Encryption, select 128-bit AES (faster) or 256-bit AES (more secure).
      Select encryption type
    • Enter and verify your password.
      Enter a password
  6. Finally, click Save and wait for the disk image to be created.
    Select the image format

Once the .dmg file is ready, you can delete the original folder. To access your files in the future, double-click the disk image, enter the password, and it will open like a secure drive.

Note Simply closing the disk image will create unprotected copies of the files alongside the .dmg file. To prevent this, always use the eject option to close the disk image, just as you would when removing an external drive. To do so, go to File → Eject.

2. Create a Password-Protected ZIP File via Terminal Window

If ejecting the disk image every time you close it feels like a hassle, and you’re familiar with Terminal commands, you can use the Terminal window to create a password-protected ZIP file of the folder instead. Here’s how: 

  1. Open Terminal and type the following command: zip -er ProtectedFolder.zip FolderName
    Open terminal and type zip  er protectedfolderzip foldername
  2. Before hitting the Return key, make sure: 
    • Replace ProtectedFolder.zip with your desired filename
    • Replace FolderName with the actual folder’s name.
  3. Once done, hit Return and enter your password.
    Once done hit return and enter your password

This creates a password-protected ZIP file. You’ll need to enter the password whenever you unzip it. 
 
Now, you can either delete the original folder if you no longer need it or save it somewhere safe away from prying eyes.

3. Using Third-Party Apps

Not everyone is good at writing Terminal commands; even one wrong character can wreak havoc in the system. If you prefer a simpler interface or extra features, consider trying third-party apps like Privaulty, Hider Pro, or Encrypto.  
 
These apps make it easy to lock files and folders, but may come with a cost. Since macOS already provides Disk Utility and Terminal, many users stick with the built-in options.

Alternative Solution: Hide Sensitive Folder on Mac

If password-protecting a folder natively on Mac feels complex and you don’t wish to spend on third-party apps, another simple way to keep files out of sight is to hide the folder using Terminal. While this doesn’t provide actual security like password protection, it’s useful for keeping sensitive files away from casual snooping. Here’s how you can do it: 

  1. Open Terminal
  2. Type in ‘chflags hidden‘ and drop the folder you want to hide onto Terminal, and the folder path will appear next to the command.
    Type in chflags hidden
  3. Press the Return key, and the folder will disappear from the Finder.
    The folder path will appear next to the command

To view the hidden folder:

  1. Open Finder and press the Command + Shift + . (period) keyboard shortcut to toggle hidden files and folders. 
  2. The hidden folder will appear slightly faded, but you can open it normally. 
  3. Press the same keyboard shortcut to hide the folder again.

To permanently unhide the folder, simply replace the ‘chflags hidden’ command with ‘chflags unhidden‘ and hit Return.

Tips for Managing Password-Protected Folders

Now that you know how to password-protect your files and folders on a Mac, use these tips to manage them:

  • Use a strong password combining letters, numbers, and symbols.
  • Store your password safely (e.g., in iCloud Keychain or a password manager).
  • Remember that if you forget the password, you may lose access permanently.
  • Always delete the original folder after securing it.

Secure Your Files the Right Way…

And that’s it; now you know how easy it is to password-protect a folder on a Mac once you know which tool to use and how. Disk Utility is the most secure option, while Terminal offers a quick solution for creating encrypted ZIP files. For a user-friendly experience, consider opting for third-party apps.

Which method do you prefer for securing your folders on Mac? Let us know in the comments.

FAQs

Can I lock a folder in macOS without third-party software?

Yes. macOS includes built-in tools like Disk Utility and Terminal that let you create encrypted disk images or compress folders without relying on third-party apps. Disk Utility is the most secure option for password protecting a folder.

Is it possible to decrypt a locked folder if I forget the password?

No. If you lose or forget the password for an encrypted disk image, there’s no built-in way to recover it. Apple doesn’t provide a password reset option for encrypted folders, so it’s important to store your password securely (e.g., in the Password app).

How to increase the size of an encrypted disk image container?

You can create a new larger disk image and transfer the contents of the old one to it. Currently, macOS doesn’t allow direct resizing of encrypted disk images. When creating the new image, select a larger size to give yourself room for future files.

Which encryption option (128 vs 256 AES) is best on Mac?

Both are secure. 128-bit AES encryption is faster and sufficient for most users. 256-bit AES encryption provides a higher security level but may slightly reduce performance. If you’re protecting highly sensitive data, 256-bit is the better choice.

Can someone else open my encrypted folder on another Mac?

Yes, as long as they have the .dmg file and know the correct password, they can open the encrypted folder on any Mac. macOS handles the decryption process natively, so no additional software is required.

Also read:

Add Igeekblog as a preferred source on Google

Ankur
Ankur

I have been an Apple user for over seven years now. At iGeeksBlog, I love creating how-tos and troubleshooting guides that help people do more with their iPhone, iPad, Mac, AirPods, and Apple Watch. In my free time, I like to watch stand up comedy videos, tech documentaries, news debates, and political speeches.

Articles: 153

FaceTime Like a Pro:

Get our exclusive Ultimate FaceTime Guide 📚 — absolutely FREE when you sign up for our newsletter below.

Leave a Reply

Your email address will not be published. Required fields are marked *