How can you configure a headless Ubuntu server to auto-mount an encrypted USB hard drive?

I found this similar question, which explains how to mount the drive from the command line, but the author is unaware of how to automatically mount. However, Nautilus provides this functionality, by asking the user whether or not they want to "remember the password" or "forget the password immediately". If you choose to remember the password, then Nautilus will auto-mount the encrypted drive from then on.

What's the equivalent functionality from the command line? How do you configure Ubuntu to remember the password and auto-mount the drive?



Browse other questions tagged or ask your own question.