How to Lock Files on Mac — Prevent Editing and Deletion

Whether you need to stop accidental edits, keep a shared workspace organized, or hide sensitive documents from other users, macOS offers multiple built-in ways to lock files. Here is exactly how to use them—and when to upgrade to dedicated encryption.

Native macOS UI Experience for File Security
By the Editorial Team Updated recently 12 min read
Quick Answer

To quickly lock a file on Mac: Select the file in Finder and press Command (⌘) + I to open the Get Info window. Under the General section, check the "Locked" box. This prevents the file from being edited, renamed, or deleted without your Mac admin password. For hiding or password-protecting folders, you will need Disk Utility or third-party software like Folder Lock.

Table of Contents

What Does Locking a File on Mac Do?

Locking a file on macOS activates a specific file system flag (the uchg or user immutable flag) that tells the operating system: "Do not allow changes to this item."

When you lock a file on a MacBook or iMac, it prevents:

Important Limitation Locking a file on Mac does not encrypt it or hide its contents. Anyone who has access to your Mac can still open and read a locked file. If you need to stop people from seeing the file altogether, you need folder encryption (covered in Method 3 and our Recommendation section).

Find the Right Method for Your Need

What are you trying to accomplish?

Recommendation: Use the built-in Finder method. It's fast and requires no software. Jump to Method 1 →
Recommendation: Use the Terminal chflags command to batch-lock files quickly. Jump to Method 2 →
Recommendation: Use macOS Disk Utility to create an encrypted DMG. Jump to Method 3 →
Recommendation: Use a dedicated tool like Folder Lock for robust, multi-folder security. Jump to Top Pick →

How to Lock Files on Mac — Complete Guide

Below are the exact steps for the three most reliable native methods to secure files on your Mac without installing anything.

Method 1: Lock a File via Finder

This is the standard native method for macOS. It works perfectly for individual documents you want to preserve.

  1. Open Finder and locate the file or folder you want to lock.
  2. Click the file once to select it.
  3. Press Command (⌘) + I on your keyboard, or right-click and select Get Info.
  4. In the General section of the window that appears, check the box next to Locked.

To unlock a locked file on Mac, simply repeat the process and uncheck the box.

Hiding Concept Invisibility Mac Finder

Method 2: Lock a File on Mac Using Terminal

If you prefer using command-line tools, or if you need to lock a massive batch of files instantly, macOS Terminal utilizes the chflags (change flags) command.

Terminal Command Security Context
Terminal - Lock File
chflags uchg /path/to/your/file.txt

Step-by-step:

  1. Open Terminal (Command + Space, type Terminal).
  2. Type chflags uchg and press the Spacebar once.
  3. Drag and drop the file you want to lock directly into the Terminal window (this auto-fills the file path).
  4. Press Return.
Terminal - Unlock File
chflags nouchg /path/to/your/file.txt

To unlock, use the nouchg flag instead.

Method 3: Password Protect Folders via Disk Utility

If your goal is to prevent someone from opening and reading the files (not just prevent editing), you must use encryption. macOS can do this by turning a folder into a password-protected disk image (.dmg).

Data Protection Vault macOS Security
  1. Open Disk Utility (found in Applications > Utilities).
  2. In the top menu bar, click File > New Image > Image from Folder...
  3. Select the folder you want to protect and click Choose.
  4. Change the Encryption dropdown to 256-bit AES encryption.
  5. Enter and verify a strong password.
  6. Change Image Format to read/write (so you can add files to it later).
  7. Click Save.

You can now delete the original unencrypted folder. To access your files, double-click the new .dmg file and enter your password.

Folder Lock vs File Encryption — Key Differences

Understanding the difference between locking, hiding, and encrypting is crucial to picking the right tool.

Method Prevents Editing? Prevents Deletion? Requires Password to Read? Best For
Finder Lock box Yes Yes No Preventing accidental changes to final drafts.
Terminal (chflags) Yes Yes No Batch-locking system files or large directories.
Disk Utility DMG Yes Yes Yes Free, secure protection for a single isolated folder.
Folder Lock Software Yes Yes Yes Managing multiple secure folders easily across devices.

The Tool We Recommend for Complete Security

While macOS native tools are great for basic tasks, creating DMG files every time you want to secure a new folder is tedious. For robust, on-the-fly encryption and cross-platform compatibility, we recommend Folder Lock for Mac.

Folder Lock for Mac Interface Dashboard
AES 256-bit Encryption macOS 13+ Compatible Cloud Sync & Share
Try Folder Lock Free → Get the Full Version →

Why Use Dedicated Folder Lock Software?

If you regularly handle sensitive tax documents, client data, or personal records, third-party folder lock software overview shows a distinct advantage over native Mac tools.

Folder Lock Mac OS Screenshot

AES 256-bit Desktop Lockers

Instead of manually packaging files into a cumbersome disk image via Disk Utility, Folder Lock for Mac allows you to create dedicated local encrypted vaults. Using military-grade AES 256-bit encryption, your sensitive documents, creative projects, and personal photos are secured on-the-fly directly on your hard drive without any storage size guesswork.

Military Grade AES 256 Encryption Security

Cross-Platform Sync

A locked macOS Disk Utility DMG cannot be natively opened on a Windows PC or an Android smartphone. Folder Lock provides true cross-platform synchronization. You can encrypt files on your Mac and seamlessly access them on Windows, iOS, or Android devices, ensuring your data is available and secure wherever you go.

Cross Platform Synchronization across devices

Cloud Drive Integration

How do agencies migrate content to the cloud securely? They encrypt files before uploading. Folder Lock integrates directly with Dropbox, Google Drive, and OneDrive. It encrypts your files locally with your own keys before they sync, meaning your data remains completely unreadable even if your cloud provider is ever compromised.

Secured Cloud Ecosystem Integration Security

Password-Free Secure Sharing

Sharing confidential files usually means taking the risk of sending a password via email or text message. Folder Lock utilizes advanced asymmetric encryption, allowing you to share encrypted files securely. Authorized colleagues or family members can access the shared files using their own unique credentials, meaning you never have to hand over your master password.

Secure File Sharing and Data Transfer

macOS Security Deep Dive

Understanding how macOS handles file permissions helps you manage your data securely. We highly recommend understanding file encryption explained basics before exploring advanced macOS permissions.

Read-Only is a permission setting. It means your specific user account can view the file but not alter it. However, if you are the owner, you can easily change the permission back to Read & Write.

Locked is a file system flag (uchg). It applies to the file itself, regardless of who is trying to open it. Even the owner cannot alter the file until the lock flag is specifically removed. Locking is a stronger safeguard against accidental deletion.

Drive Locking Technology vs FileVault

FileVault is Apple's native full-disk encryption. When your Mac is powered off, your entire hard drive is unreadable. However, once you log in with your password, the entire drive is decrypted. Anyone who sits at your unlocked Mac can read all your files.

Third-Party Folder Lock Software provides file-level encryption. Even while you are logged into your Mac and actively working, your specific secure folders remain locked and encrypted until you type a secondary password to open them.

Encrypted Secure Notes and Secrets Vault

While macOS comes with Keychain for basic password management, it doesn't offer a dedicated, robust environment for secure textual notes or digital wallets out of the box. Folder Lock's Secrets feature fills this gap for Mac users by allowing you to store private notes, banking information, credit card details, and assorted passwords in a heavily encrypted vault. This keeps your most sensitive textual and financial data isolated and protected from prying eyes.

Troubleshooting Storage and Recovery

When dealing with system file locking, recovery, and device resets, users often face critical data access issues. Here are the facts regarding common recovery queries.

Local Data Recovery and Deletion Prevention

Can I Delete Recovery Folder?

On macOS, there is a hidden volume named Recovery HD. You should not delete the system recovery log files or the recovery partition. Doing so removes your ability to reinstall macOS, use Disk Utility in emergencies, or reset a forgotten admin password. If you are trying to free up space, use the built-in Storage Management tool instead.

Can I Recover Data After a Factory Reset?

If you perform a factory reset (Erase All Content and Settings) on a modern Mac with a T2 Security Chip or Apple Silicon (M1/M2/M3), the answer is generally no. Modern Macs use hardware-level encryption. A factory reset destroys the cryptographic keys required to read the drive. After you have deleted a file this way, you can never recover it again, so be careful what you delete.

The same applies to mobile devices: Android data recovery after factory reset encryption is nearly impossible without a prior cloud or local backup.

Recovering from Forgotten Folder Lock Password

If you encrypt a DMG or use advanced folder security software and forget the password, there is no "backdoor." According to security training, true encryption services never require recovery keys or passwords to unencrypt data for the vendor. If you lose the password, the data is permanently locked. Always keep a secure backup of your master passwords in a dedicated password manager.

Customer Testimonial Illustration

User Testimonials

"
★★★★★

"I used to use the Terminal chflags method to lock my client asset folders, but it was tedious. Switching to a dedicated folder locking tool saved me hours and gave me peace of mind with AES encryption."

David M. Freelance Designer
"
★★★★★

"The Disk Utility DMG method is good for one folder, but terrible if you need to access files daily. Upgrading to real folder password software made organizing my tax documents so much easier."

Sarah T. Small Business Owner
"
★★★★★

"I share my iMac with the family. Using the invisible folder lock feature means the kids can't even see my work folders, let alone accidentally delete them. A massive lifesaver."

James K. Remote Worker

Pricing: What You Get

Folder Lock Free

Basic Encryption for Mac

  • 1 GB Desktop Locker capacity
  • 1 GB Cloud Locker capacity
  • Sync across up to 2 devices
  • AES 256-bit encryption

Folder Lock Pro

Unlimited Complete Security Suite

  • Unlimited Locker capacities
  • Sync across up to 5 devices
  • Secure file sharing with users
  • Secrets vault (Notes & Wallets)

Frequently Asked Questions

What does locking a file on Mac do?

Locking a file in macOS enables the uchg flag, which prevents the file from being modified, renamed, or easily deleted without entering an administrator password. It acts as a safeguard against accidental changes.

How to lock a folder on Mac?

You cannot use the simple Finder "Locked" checkbox to secure the contents of a folder (users can still add/remove items inside it). To truly lock a folder, you must use Disk Utility to create an encrypted DMG image, or use third-party folder lock software.

Can a locked file on Mac still be read?

Yes. The native Mac locking feature only prevents editing and deletion. Anyone with access to the Mac can double-click and read the locked file. For privacy, you need encryption.

Is folder locking the same as folder encryption?

No. Folder locking typically means hiding the folder or restricting access via OS-level permissions. Folder encryption scrambles the actual data mathematically (using standards like AES 256-bit), meaning even if someone steals the hard drive, they cannot read the files without the password.

How to find folder lock files if they disappeared?

If you used a "hide folder" feature and forgot where it was, you can press Command + Shift + . (period) in Finder to show hidden files. If you used dedicated software, you must open the software interface and enter your master password to reveal the locked items.

Can you lock files on Mac without software?

Yes, you can use the "Locked" checkbox in the Get Info panel to prevent edits, or Disk Utility to create encrypted DMG folders for privacy. However, these methods are manual and slower than using dedicated applications.

Can I recover data from a dead phone or SSD?

If the device was unencrypted, advanced file recovery software might pull data from a dead SSD or broken screen device. However, modern Apple SSDs and phones use hardware encryption; if the logic board is dead or the device was factory reset, data recovery is typically impossible.

The Bottom Line

For preventing accidental typos or deletions, the native Mac "Locked" checkbox is perfect. However, if you are handling confidential data, client files, or personal financial records, you need true encryption. Folder Lock provides the easiest, most robust way to secure your folders locally, on USBs, and in the cloud.

Try Folder Lock Free → View Full Version Pricing →