Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a 10.04 desktop machine that I use as a NAS. I have 3 shares on that box which I've been attaching to via mounting at startup in my fstab. I don't like the fact that have my user name and password right out in the open in my fstab. Here's how I'm doing this today..

//192.168.0.40/Data                               /media/NAS-Data   smbfs     username=my-name,password=my-password@  0  0  

BTW, am no necessarily married to smbfs, but do want a way to have the credentials cached/saved so I don't have to enter them at startup (if doable)...

share|improve this question

1 Answer 1

up vote 1 down vote accepted

For a samba/CIFS share, you can use a credentials file storing your username/password like this (domain is optional) :

username=my_username
password=my_password
domain=my_domain

Protected with rights with a chmod 600 (only readable by root)

And in your fstab :

//192.168.0.40/Data     /media/NAS-Data   smbfs     credentials=/path/to/your/credential_file  0  0  
share|improve this answer

Your Answer

 
discard

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.