Forum Discussion
SirRaott
Jul 30, 2025Iron Contributor
How to lock a folder on mac with password without disk utility?
Hi tech experts, I share a MacBook Pro at home with my younger brother. Everything works fine as the computer has decent hardware specs. However, there is one annoying issue that my brother could ea...
Sasompark
Jul 30, 2025Iron Contributor
While you mentioned "without Disk Utility," creating a password-protected disk image is the most straightforward free method to lock a folder on Mac. This typically involves Disk Utility, but you can also do it via Terminal, which is free and built-in.
Here's how to lock a folder on Mac via Terminal:
- Open Terminal (Applications > Utilities > Terminal)
- Create a sparse disk image:
hdiutiil create -size 100m -fs HFS+J -volname "PrivateFolder" ~/Desktop/PrivateFolder.dmg
Adjust -size 100m to your needs.
This creates a disk image named PrivateFolder.dmg on your Desktop. - Convert the disk image to be password protected:
You can create a new encrypted image with:
hdiutiil create -encryption -size 100m -volname "PrivateFolder" -fs HFS+J ~/Desktop/PrivateFolder.dmg
During this process, you'll be prompted to set a password.
Note: About how to lock a folder on Mac. The above commands create a new encrypted disk image. You can then mount it and add your private files inside. When done, eject it; the files are protected.