Another way to use personal web sharing and FileVault
I noticed that Personal Web Sharing was only partially functional when using FileVault. More precisely, accessing the users web pages inside ~/Sites using a URL similar to http://localhost/~username would always fail with a permissions error. The reason for this failure is fairly simple. When the FileVault user logs in, the encrypted disk image /Users/.username/username.sparseimage is mounted as /Users/username. Apple righty decided that a user using FileVault was trying to protect personal data, and so they set the access rights of /Users/username to 700 (rwx------), thus allowing only the user herself to access anything in her $HOME directory. Unfortunately, this has the side effect of preventing the local Apache server from accessing the contents of /Users/username/Sites/ resulting in the aforementioned error. A simple but unsafe solution: A simple solution would be to change the access rights of ...
published on Monday, the 31. December 2008, macosxhints
10.5: Leopard, Spotlight, and sparse disk images
After moving some .sparseimages I created in Tiger to Leopard, upon mounting them, I noticed that Spotlight was not finding items that I knew existed on them. After turning off and re-enabling indexing for the volumes via Terminal several times with no luck, (and yes, I did wait long enough for Spotlight to finish the indexing process), I realized that if I created a new folder on the .sparseimage, it would show up in a search. However, none of the pre-existing files/folders would be found. Then I tried renaming one of the pre-existing folders, and the new name showed up in a search. Then I renamed it back to the original name, and all was well. I also noticed that renaming only seems necessary for items on the top level of the disk, since any nested items I searched for started showing up in Spotlight after renaming the top folder. [robg adds: I can't confirm t...
published on Tuesday, the 4. December 2007, macosxhints
Possible recovery of a corrupted FileVault disk image
Somehow my FileVault image became corrupted, and I could not login. The following steps helped me get things working again. First, login as the root user -- you'll need to enable root (Pre-10.5, 10.5). On your hard drive, find this file: /Users » username » username.sparseimage; it might instead be found in /Users » .username %raquo; .username.sparseimage, where username is the short username of the user with the corrupted image. Make a copy of this fiel for back up purposes, in case something goes wrong. Of course you can try to mount it, repair permissions, etc., but I was not able to do this. Next, reboot your machine from the DiskWarrior CD. In the DiskWarrior window (in t...
published on Monday, the 19. November 2007, macosxhints
FileVault Lite
Several people want to use FileVault-type protection on less than their entire home folder. I do this to use the same type of protection but for a single folder.1. Using Disk Utility (in Applications > Utilities), create a sparse disk image using AES-128 encryption. I made mine the size of a DVD so it would never become too large to back-up to a DVD. Also, I saved mine at the top level in my home directory. 2. When creating the password, be sure to leave "Remember Password" checked, so that your keychain can open your disk. 3. Go to the Accounts preference pane (in Applications > System Preferences), and under Login Items, click + to add a login item. 4. Navigate to your 'xxxx.sparseimage' file and add it to the login items list. Now it will auto-mount every time you login. The only down-side to this hint that I can come up with is that the user must be proactive about where he or she places files. Also, if you place a file in the w...
published on Wednesday, the 3. October 2007, macosxhints
10.4: Move a FileVault home directory between Macs
I wanted to add the user of a different Mac to my new Mac by copying his home directory to the new Mac. I like to use FileVault for home directories, and the user has a FileVault directory on the original Mac, so I thought I could do this:Create a new user on the new Mac, with same username, password, and short name.Set up FileVault on the new location for the user.Copy the sparseimage file from the original Mac to the new home directory.Well, yes and no. When I tried to log in as the user on the new Mac, I kept getting the error: 'Home folder for user "Some User" cannot be found in the usual place,' where "Some User" was the user's username on the new Mac.I tried to fiddle with the permissions (setting ownership of the directory of the user to the user, chmod 777, emptying ~/Library/Caches, all sorts of things), but couldn't get it to work. T...
published on Thursday, the 3. May 2007, macosxhints
10.4: Compact sparse disk images via contextual menu
The following Automator workflow will simplify compacting a sparse disk image. You need to occasionally compact sparse disk images, because while they will grow automatically as you add files, they won't shrink when you delete files. Open Automator in Applications Folder, and create this workflow: Finder Library » Get Specified Finder Items Action Finder Library » Filter Finder Items, and select Name Extension is equal to sparseimage. Automator Library » Run Shell Script and select Pass input as arguments and replace the sample script with hdiutil compact $@. Save as Plugin for Finder (name it Compact Sparse Disk Image). In the Finder, select a sparse disk image and ctrl-click, go to the Automator entry, and select Compact Sparse Disk Image. That's it!
published on Thursday, the 29. March 2007, macosxhints
Mount multiple encrypted disk images via AppleScript
Since my main machine is a PowerBook G4, I have a real fear of it being stolen or lost somehow. It's not so much the loss of the computer itself that concerns me, but the personal data on it. My answer to this is to use multiple sparseimage files (disk images) which are encrypted and, thus, password protected. OS X is fantastic in this regard -- all of this capability is built right in, and integrated well into the underlying operating system.Basically, I create disk images sort of like categories: one for client work, one for personal information, one for family documents, et al. The problem is that when you mount each one by double-clicking it, you must authenticate. It's a real chore. So, I set out to create an AppleScript which would help to automate this process.This script will do just that. When run, it will first prompt you for a password. One caveat is that all disk ...
published on Tuesday, the 2. January 2007, macosxhints
How *not* to change account passwords in 10.3
I've been running FileVault with OS X 10.3 for a long time, and have been generally very impressed with its robustness-- even when I had some bad blocks on my drive. Recently I thought I should lengthen, and so strengthen, my account login password. So I went to the Accounts pane in System Preferences, inserted the cursor to the right of the seven bullets that represented my current password, added 10 more characters, repeated the operation in the Confirm Password field below, and my new password was accepted. As you may know, those seven bullets show up in the Password field in this version of OS X -- no matter what the length of your password, or, indeed, even if that account doesn't even have a password. In fact, my original password, represented by those seven bullets, was actually nine characters. In any case, what happened next was that I could not log into my account with my now-changed password, and, hence, could not unlock the FileVault sparseimage containing my h...
published on Thursday, the 24. August 2006, macosxhints
Store files securely on a USB flash drive
I wanted to securely carry files on a USB flash drive. I wanted a system that would be safe if I lost the drive, but not necessarily encrypt and decrypt every file on it. I found some shareware encryption solutions, but I wanted a way that was free. Here's my solution: If the flash drive is MS-DOS formatted, use Disk Utility to reformat the USB drive to Mac OS format without the OS 9 drivers. In Disk Utility, choose File -> New -> Blank Disk Image. Select a size that is less than the flash drive's maximum size, then select Encryption -> AES-126, then select Format -> Sparse Disk Image. Select Create, you will then be asked for a password. Provide the password and save the image to your hard drive. Copy the file secure-disk-name.sparseimage to the USB drive. Open the sparseimage file from the flash drive. You will be asked for the password. A new drive will appear with the name of the sparseimage drive you created. Sav...
published on Friday, the 4. August 2006, macosxhints
Store files securely on a USB flash drive
I wanted to securely carry files on a USB flash drive. I wanted a system that would be safe if I lost the drive, but not necessarily encrypt and decrypt every file on it. I found some shareware encryption solutions, but I wanted a way that was free. Here's my solution: If the flash drive is MS-DOS formatted, use Disk Utility to reformat the USB drive to Mac OS format without the OS 9 drivers. In Disk Utility, choose File -> New -> Blank Disk Image. Select a size that is less than the flash drive's maximum size, then select Encryption -> AES-126, then select Format -> Sparse Disk Image. Select Create, you will then be asked for a password. Provide the password and save the image to your hard drive. Copy the file secure-disk-name.sparseimage to the USB drive. Open the sparseimage file from the flash drive. You will be asked for the password. A new drive will appear with the name of the sparseimage drive you created. Sav...
published on Friday, the 4. August 2006, macosxhints