0

I have the following entry in my fstab file:

//10.30.1.235/Restrito/BackupVms /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.

Example:

username=admin
password=123456

If I execute in command line:

mount -t cifs //10.30.1.235/Restrito/BackupVms /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?

0

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

For example, if 10.30.1.235 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:

username=admin
password=123456
domain=servidor01
  • 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.