Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Create Hidden Files and Folders and Password Protected Files/Folders

Hi

How can I create a hidden file/folder?

Also, how can I create a folder that can only be accessed with a password?

thanks

PowerBook G4 1.33 GHz PowerPC G4, Mac OS X (10.5.8)

Posted on Nov 10, 2010 3:03 PM

Reply
12 replies

Nov 10, 2010 3:11 PM in response to rickytitus

Hi

+"How can I create a hidden file/folder?"+

Launch Terminal (Applications > Utilities) and use this command:

sudo hidden /pathtowhateveryouwanttohide


To make it visible again:

sudo nohidden /pathtowhateveryouwanttohide


+"how can I create a folder that can only be accessed with a password?"+

Use Disk Utility (Applications > Utilities) to create an encrypted password protected disk image of the desired folder.

Tony

Nov 11, 2010 12:54 PM in response to rickytitus

Before going forward, are you sure that "hiding" an item is the right approach for your particular needs?

This might provide some minimum protection against curious, non-tech-oriented family members, but not much more than that. It is very easy to give Finder the ability to see hidden files - there are free utilities and even a widget that will do this, as well as a simple Terminal command. The only way to really secure your data is to encrypt it.

Nov 16, 2010 9:09 AM in response to rickytitus

Hi

If you truly typed:

sudo hidden /Users/yourname/Desktop/test.dmg


Then you're doing it wrong. You should be typing:

sudo chflags hidden /Users/yourname/Desktop/test.dmg


Another possible reason why it may not be working is if you've not set a password for your local admin account then nothing will happen when issuing "sudo". Define a password for your account, issue the command again and it will work.

Tony

Nov 16, 2010 9:47 AM in response to rickytitus

Also, be aware that it is easy to "lose" the items that you hide!
If you need to find them, you can temporarily enable Finder to see all hidden items, without removing the "hidden" flags on the items themselves. I like to use the free utility [TinkerTool|http://www.bresink.com/osx/TinkerTool.html] for this - check the first box TinkerTool's Finder tab, then click Relaunch Finder at the bottom right. To re-hide hidden items from the Finder, just uncheck the TinkerTool box and again relaunch the Finder.

And as I said earlier, any knowledgeable user could do this as well, which is why "hiding" things this way doesn't provide any real security.

Nov 19, 2010 2:29 PM in response to Larry V.

Yes, provided you have access to SetFile. It isn't present in a default OS X installation - it gets installed as part of XCode Developer Tools.

SetFile and chflags do seem to act upon the same metadata item. I looked into this a while back, and posted my findings here:
http://discussions.apple.com/thread.jspa?messageID=11802965&#11802965

There is one difference that I know of, which is that SetFile can be used to hide/unhide symlinks (if you add a -P option), whereas chflags cannot do this. This comes up from time to time when someone reports that the hidden symlinks /var, /tmp, and /etc have become visible, and wants to re-hide them. You can't use chflags for this.

Message was edited by: jsd2

Create Hidden Files and Folders and Password Protected Files/Folders

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.