Locked in Finder is not password protected: what the Locked box does
· 7 min read
To lock a file on a Mac, select it in Finder, press Command-I to open Get Info, and tick Locked in the General section. From then on the file cannot be edited or renamed, and Finder asks before it goes in the Trash. That is the whole job: there is no password, nothing is encrypted, and anyone using your account can untick the box, or simply open and read the file while it stays locked.
Locked protects a file from accidents, not from people. Here is what it really does, why files sometimes say they are locked when you never touched the box, and what to use when you actually need a password.
How to lock a file on a Mac
- Select the file or folder in Finder.
- Press Command-I, or choose File, Get Info.
- In the General section, tick Locked.
To lock several items at once, select them all and press Option-Command-I. That opens a single Inspector window rather than one Get Info window per item, and the Locked checkbox there applies to the whole selection.
Documents open in TextEdit, Preview, Pages, Numbers, Keynote and other apps built on Apple’s document system can be locked from the window too. Click the document’s name in the title bar and a panel drops down with a Locked checkbox. While the lock is on, the title bar shows Locked next to the name.
In Terminal, the same lock is a file flag called uchg, short for user immutable:
chflags uchg ~/Documents/Contract.pdf
chflags nouchg ~/Documents/Contract.pdf
ls -lO ~/Documents/Contract.pdf
The first line locks the file, the second unlocks it, and ls -lO shows uchg in the flags column while it is locked. Ticking the box in Get Info and running chflags uchg set exactly the same flag.
What the Locked box actually does
The flag tells macOS that the file must not change. In daily use that looks like this:
- Editing is blocked. Apps built on Apple’s document system say “The file is locked” and offer two ways forward: Unlock, which removes the lock so you can carry on, or Duplicate, which gives you an unlocked copy and leaves the original alone.
- Renaming is blocked. The name cannot change while the flag is set.
- Trashing needs a second yes. Finder asks whether you want to move the locked item to the Trash anyway.
- Emptying the Trash with locked items in it brings another question: remove everything, including the locked items, or only the unlocked ones.
For a folder, Locked protects the folder itself. It cannot be renamed or trashed without that question, and items cannot be added to it or removed from it. The files inside can still be edited, unless you lock them too.
This is genuinely useful for a signed contract, a finished invoice, a template you keep overwriting by mistake, or anything you want to stay exactly as it is.
What it does not do
There is no password. Unticking Locked asks for nothing, as long as the file belongs to you. It is a speed bump for your own hands, not a door.
Nothing is encrypted. The contents sit on the disk exactly as before. Any app you run can read the file, Quick Look previews it with a tap of the Space bar, Finder shows its thumbnail, and Spotlight indexes the text inside it.
Nothing is hidden. The name, icon and preview all show normally.
Copies travel unprotected. Email a locked file or upload it, and the copy that arrives is an ordinary file, open to anyone who receives it.
If the reason you went looking for a lock was “someone else might open this”, Locked is the wrong tool.
Why a file says it is locked when you did not lock it
“The file is locked” is a common message, and the Locked checkbox is only one of several causes. Work down this list.
The flag was set long ago. Earlier versions of OS X could lock documents automatically once they had gone a while without an edit, and an old document can still carry that flag today. Open Get Info and look: if Locked is ticked, untick it.
The file is in the Trash. Apps refuse to edit anything in the Trash and say it is locked for that reason. Drag it back out first.
It lives somewhere read-only. A disk image mounted read-only, a network share where you only have read access, or a drive formatted for Windows (NTFS, which macOS can read but not write) all produce a lock message that no checkbox can clear. Copy the file to your Mac and edit the copy.
You do not have write permission. Scroll to Sharing & Permissions at the bottom of Get Info. If your name shows Read only, or the file belongs to another account, click the padlock, enter an administrator password and change your privilege to Read & Write. The same section is the place to look when the Locked checkbox itself is dimmed.
Another app has it open. Microsoft Office keeps a hidden file starting with ~$ beside a document while it is open. If a crash leaves one behind, or a colleague has the same shared file open, Office can report the document as locked for editing. Closing the other copy usually clears it.
To clear the Finder flag from a whole folder of files at once, Terminal is quicker than a stack of Get Info windows:
chflags -R nouchg ~/Documents/Old\ Projects
The -R works through everything inside the folder, so check the path before you press Return.
Two other locks that are not this one
Stationery pad sits right next to Locked in Get Info. It turns a file into a template: opening it gives you a new copy to work on, and the original is left alone. It is handy for forms you fill in again and again, and it is not a lock either.
Arrange, Lock in Pages, Numbers and Keynote locks a selected object on the page, such as an image, a shape or a text box, so it cannot be moved or edited by accident. It has nothing to do with the file.
When you need a real password
Encryption is what keeps other people out. The options depend on the file:
- PDFs, Pages, Numbers, Keynote and Office documents can carry their own password to open. How to password protect any file on a Mac covers each format, and what to do for photos, videos and everything else.
- Whole folders can go into an encrypted disk image made with Disk Utility. How to password protect a folder on a Mac compares that with the alternatives.
If you want a file or folder to stay where it is and simply need a password to open it, Hushbox adds Lock with Hushbox to the Finder right-click menu. The item becomes an AES-256 encrypted disk image in the same folder, opened with Touch ID or a password, and it locks again by itself when the screen locks. One practical note: it will not lock an item that has the Finder Locked box ticked, so untick that first. And hiding a file is not a substitute for any of this; hiding a folder explains why.
Questions
How do I lock a file on a Mac so nobody else can open it? Finder’s Locked checkbox cannot do that. Use a password to open (PDF, Pages, Numbers, Keynote, Word), an encrypted disk image, or an app that encrypts the file where it sits.
Why is the Locked checkbox dimmed in Get Info? You do not have permission to change the file, usually because it belongs to another account or sits on a read-only disk. Check Sharing & Permissions at the bottom of the same window.
Does Time Machine back up locked files? Yes. The Locked flag has no effect on backups; Time Machine copies the file like any other.
Can a locked file still be copied? Yes. Locked stops changes to that file, not copies of it. An email attachment or an upload made from it is an ordinary file that can be opened and changed freely.