[CentOS] CIFS Share with encrypted credentials

Tue Oct 1 14:06:40 UTC 2013
Dolev Farhi <dolev at sys-blog.net>


Hi,

I have a CIFS share that I mount on a CentOS6.4.

Currently I am keeping the password in a regular hidden file, for
example /test/.cred with the username and password.
the /etc/fstab directive points to that file.
for example:

//10.0.0.1/share     /mnt        cifs       
defaults,credentials=/test/.cred 

Since this file is readable by the root user, I figured if there might
be a way to encrypt this file, and with decrypt this file with a script
so the mount will succeed, and then encrypt it again. or maybe there is
another way of doing this? any ideas?



---
Dolev