Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get my ubuntu server 12.04 to automatically mount the encrypted home partition after an ftp login? It will automatically mount after an ssh login and I can then access the encrypted information over ftp but I don't want to have to log into ssh every time I want to use ftp.

share|improve this question
How is SSH mounting it? – Ignacio Vazquez-Abrams Dec 16 '12 at 6:02

When you login into your system, either directly or via ssh, it is usually the pam_ecryptfs module that takes care of automatically mounting your encrypted home.

This module will use your password to decrypt a better key (referred to as passphrase in the docs) and make your encrypted home directory available.

Setting up pam_ecryptfs for FTP logins seems like a really bad idea, though. FTP sends passwords (and data) in clear text. This means that anyone on your network will be able to steal your password and be able to decrypt your data.

I would either:

  • Not use FTP. Use sftp, scp, putty, winscp, whatever, based on ssh.
  • If you have to use FTP, I would not encrypt the data at all. Assume that once you do the first transfer, anyone will be able to access it anyway. Or create a subdirectory where you keep data available via FTP.

If you really really want to enable mounting encrypted directories automatically with ftp, you can add a line like:

auth required unwrap

in /etc/pam.d/proftpd, assuming your FTP server is proftp.

If you use this and it works, please tell us you are using a VPN or a socks proxy over an SSL tunnel or ssh. Lie if you have to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.