Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I want to be able to store the login details all of my remote FTP accounts in one place, securely. Then I'd like clients like autofs/curlftpfs, Filezilla, etc to use this one store of passwords. I'm not interested in GUI-dependent solutions. Is this possible somehow?

share|improve this question
up vote 5 down vote accepted

Ideally those would be SFTP accounts, using SSH public key authentication rather than passwords. You'd gain both security and convenience. But let's assume you don't have a choice of not using FTP with passwords.

You could store the passwords (the .netrc file) on an encrypted filesystem and mount that filesystem only when you want to access it. A simple way to create an encrypted directory tree is encfs. Setup:

# install encfs, e.g. apt-get install encfs
mkdir ~/.passwords.d
encfs ~/.passwords.encfs ~/.passwords.d
mv ~/.netrc ~/.passwords.d
ln -s .passwords.d/.netrc ~
fusermount -u ~/.passwords.d

Daily use:

encfs ~/.passwords.encfs ~/.passwords.d
ftp …
fusermount -u ~/.passwords.d
share|improve this answer
Wow, that's great! In you opinion, would that encrypted directory be safe to upload to a remote backup location? – Matt Alexander May 16 '11 at 18:56
I connect to most things via SFTP/SCP, but some clients' production servers are FTP only. – Matt Alexander May 16 '11 at 18:57
@mattalexx: Yes, you can back up the encrypted directory. Of course, make sure your password is strong enough to withstand brute force attacks. – Gilles May 16 '11 at 19:07
FTP is insecure, all traffic is plain text, no encription (not even passwords!). – vonbrand Jan 26 '13 at 3:04

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.