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

Password on encrypted volume not being "forgotten"

I've set up an encrypted disk image (sparsebundle) and written a short bash script to simulate the old-style FileVault (to protect just a single account.) It uses a folder within the encrypted volume as the home folder of an account that I use for sensitive information. While it took a little while to get the permissions/ownership right on the volume and image, it works fine. The other tricky part was that I have the script close the volume after it detects the account has been logged out -- I discovered I needed to wait a while for the logout to complete before closing the volume (otherwise it seemed like the system was trying to read or write from the volume even after "who" showed the account was logged out, and so it created a new home directory that confuses things.) Now, the "problem" I have is this. The first time the script opens the encrypted volume the system of course asks for the password. Thereafter unless I reboot (logging in and out of the non-protected account I start the script from doesn't help) and possibly after a *long* time, tthe system seems to be remembering the password to the file -- on subsequent uses of the script the volume is opened without me being asked for the password. I have examined carefully what I do when entering the password to make sure it's not saved in the keychain -- and indeed it isn't (verified by looking at the keychain). Does anyone have any idea where the system (presumably the Finder) is saving the password and how to get it to "forget" it? (I just realized I haven't checked to see if the password is "remembered" system-wide or just in the un-protected account.) I've looked in both the system and account set of caches and nothing is obvious (all the finder cached data is in a single database, presumably in some obscure format.)


Ted Lee

Minnetonka, MN

MacBook Pro (Retina, 13-inch, Late 2012), OS X Mountain Lion (10.8.3), also a desktop G4 and an early mini

Posted on May 23, 2013 8:58 AM

Reply
5 replies

May 23, 2013 11:01 AM in response to Eric Root

Yes. By the way, I just tried switching to another account (the one I use for admin purposes) and the password for the encrypted disk image was "remembered" there too (but not in any login chains there either). So it's something at a system, not account, level, and I suspect has nothing to do with the Finder per se. I should try connecting from another system as guest to see what happens, but I don't have the time right now to try that (not that it matters much since I'm on a very small home network firewalled away from the net.) Ah, I just checked with a terminal command (open) and the disk image opened without me supplying the password, so it's definitely something below the Finder.

May 23, 2013 11:26 AM in response to Theodore Lee

I just checked, and restarting does indeed cause the system to "forget" the password. What I found interesting is that if I attempted to open the encrypted image (a sparsebundle, if that matters) from a terminal window, after the password had been "forgotten", with a Unix "open" command, I got an OS X dialogue asking for the password -- not something in the terminal window (as when it asks for a sudo password.) So there isn't a pure layering of OS X and Unix.

May 23, 2013 6:10 PM in response to Theodore Lee

Some more experiments. Since I was using the encrypted image to simulate FileVault, I put the image in the /User directory (which is where the old FileVault put its image for an account.) This time I created another encrypted sparsebundle in a directory on my desktop -- the system did *not* remember the password for it (I had to enter it each time I opened it.) More interestingly, diskutil *knew* about and remembered the image I'd put in /Users, but not the one on my desktop. Diskutil even said that the volume inside it was an unmounted (encrypted) partition. So it appears the system is "remembering" images that are in the /User directory -- I have no idea if there are other directories (say, /Library) where it would be remembered too. But the "memory" has something to do with the live system -- since if I restart, the "memory" is lost. Whether it is kept in some none-obvious place in the file system that disappears on shutdown or restart or just in virtual memory I of course don't know.

May 23, 2013 7:40 PM in response to Theodore Lee

Eureka -- I figured it out. It was seeing disk utility sometimes showing "dismount" and sometimes "eject" that gave me the clue. I had been using "diskutil unmount force <myvolume>" to close the encrypted disk image. That just *unmounted* the image (partition) -- not ejecting it. Somewhere the system remembers where unmounted but still physically present disk partitions are -- including those in encrypted disk images. (I browsed through all the invisible system folders, but couldn't find any obvious one where the info is kept.) But if I used "diskutil eject <myvolume>" the system lost all knowledge of it. Now, directly using "eject" didn't work -- even though the account using the volume was logged out, the system still thinks somebody has it in use. So I had to first use "unmount force" option, then open the volume again in the script, then eject it. And that worked.

Password on encrypted volume not being "forgotten"

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