Você pode usar eCryptfs para fazer isso.
Você precisa fazer isso como usuário root, no entanto. Veja algumas instruções que funcionam:
root@server-59314:~# ecryptfs-setup-private
Enter your login passphrase:
Enter your mount passphrase [leave blank to generate one]:
************************************************************************
YOU SHOULD RECORD YOUR MOUNT PASSPHRASE AND STORE IT IN A SAFE LOCATION.
ecryptfs-unwrap-passphrase ~/.ecryptfs/wrapped-passphrase
THIS WILL BE REQUIRED IF YOU NEED TO RECOVER YOUR DATA AT A LATER TIME.
************************************************************************
Done configuring.
Testing mount/write/umount/read...
Inserted auth tok with sig [37d1d7fcf453d9d0] into the user session keyring
Inserted auth tok with sig [974bb07127cbe922] into the user session keyring
Inserted auth tok with sig [37d1d7fcf453d9d0] into the user session keyring
Inserted auth tok with sig [974bb07127cbe922] into the user session keyring
Testing succeeded.
Logout, and log back in to begin using your encrypted directory.
E então você precisa fazer o login como root e executar ecryptfs-mount-private . Observe que você provavelmente desejará garantir que / var / www não seja desmontado quando a raiz efetuar logout. Para fazer isso, apenas rm -f /root/.ecryptfs/auto-umount
.
Divulgação completa: Eu sou um dos mantenedores do projeto eCryptfs.