2

I am trying to add the below entry to /etc/vfstab on Solaris 11.2 to mount a windows shared folder on reboot time:

//192.168.1.45/share    -   /mnt/winshare  smbfs    -   yes fileperms=0777,dirperms=777

the shared is working, mount folder exists, the only issue that I don't know how and where to set the domainname, username, password, and the other issue that my password having @ character on it so if I used some thing like user:p@[email protected] it won't work.

Kindly advice.

1 Answer 1

2

As said at fstab and cifs mounting, possible to store authentication information outside of fstab? , you can use a credentials file:

credentials=filename: Specifies a file that contains a username and/or password. The format of the file is:

username=value
password=value    

This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. Be sure to protect any credentials file properly.

Example from /etc/fstab:

//192.168.1.45/share   /mnt/winshare   cifs   credentials=/root/.creda,domain=yourworkgroup

Be sure to limit file permissions to 600 on credentials file, and assure owner is root:root:

chown root:root /root/.creda
chmod 600 /root/.creda

Hope it helps!

10
  • I did that before with 0600, and I got unknown option "credintial", but I will try it again now
    – masker
    Dec 1, 2015 at 10:38
  • Well, in fact, 0600 is still better than 0700. Corrected the answer. Also note you've got a typo: credintial vs credentials.
    – emi
    Dec 1, 2015 at 10:41
  • Also forgot to ask: how about windows domain name, shall I add it to the credential file?
    – masker
    Dec 1, 2015 at 10:41
  • Thanks for correcting I am trying now, will get back to you
    – masker
    Dec 1, 2015 at 10:41
  • To fix the domain name, use domain option: //192.168.1.45/share /mnt/winshare cifs credentials=/root/.creda,domain=yourworkgroup. Updated the answer, too.
    – emi
    Dec 1, 2015 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .