I have the following entry in my fstab file:

// /backups/servidor01 cifs
vers=2.0,credentials=/spassword,iocharset=utf8,gid=0,uid=0,file_mode=0777,dir_mode=$ 0 0

spassword is a credential file in / (permission 644) where I have my password and username.



If I execute in command line:

mount -t cifs // /backups/servidor01 cifs
vers=2.0,credentials=/spassword,iocharset=utf8,gid=0,uid=0,file_mode=0777,dir_mode=$0 0

It works!

If, I try mount -a (cause it execute from fstab), the system asks me for the password.

I want it to mount automatically.
What should I do?


Your /spassword file needs a third line specifying the domain of the username. If admin is a local account on, then the domain is simply the SMB name of the host But the domain cannot be omitted.

For example, if is called SERVIDOR01 (i.e. its CIFS share might be called \\SERVIDOR01\Restrito on a Windows workstation), and admin is a local account on it (i.e it might be more fully shown as SERVIDOR01\admin), then your /spassword file should contain:

  • Hi @telcoM! I just added domain=freenas.local but it didn't work. – Jhonnatas Alencar Feb 8 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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