Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 have the following in my /etc/fstab on a Red Hat 5 system:

//share/folder /mnt/folder cifs username=<my username>,password=<my password>,ro,soft,nounix

Can I replace this with something that will still mount //share/folder on my Linux box on startup without storing my plain text password in fstab?

share|improve this question
up vote 3 down vote accepted

You can make a separate file with the following lines, and make it readable by root only:

username=<my username>
password=<my password>

Then in /etc/fstab, replace the username and password options with:

share|improve this answer
Still plain text, but better than nothing. – Stéphane Gimenez Sep 8 '11 at 15:44

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.