Automounting not working correctly for CIFS shares; weird results

Base on the above question, my issue is that my samba/cifs password do have '*' and '&' characters which point me to the lines:

if [ -e "$credfile" ]
    smbclientopts="-A "$credfile

what would be the correct way to escape the password? in the credfile


this way fail


or fix the " smbclientopts="-A "$credfile "

thanks for the comments.

2020 update: clean pop-os install

> apt install samba autofs smbclient 
> sudo nano /etc/creds/<<host>> 
> sudo chmod rw-r-r /etc/creds/<<host>> 
> sudo nano /etc/auto.master ###edit: /smb auto.smb --timeout=300 
> sudo systemctl restart autofs.service


> the ls /smb/<<host>> show all the shares 
> but ls /smb/<<host>>/<<share>> 
> ls -l /smb/ccollart/home 
> ls: cannot open directory '/smb/ccollart/home': No such file or directory


> Feb  5 11:26:33 pop-os kernel: [10292.285802] CIFS: Attempting to mount //ccollart/home
> Feb  5 11:26:33 pop-os kernel: [10292.285816] Unable to determine destination address.

I then install winbind:

sudo apt install libnss-winbind winbind

BTW, my local DNS do add searchdomain = localdomain and DNS do resolve IPv4 both "host" and "host.localdomain"

  • How did come to the conclusion that the linked question (closed without a resolution) references special characters in the credentials file? I have a few in mine (not yours, in particular) and didn't need to escape them. – ajgringo619 Nov 9 '19 at 17:23

my solution was to install CIFS-UTILS,because the FS type is opts="-fstype=cifs"

sudo apt install cifs-utils

but most of the tutorials that I follow doesn't include this step,maybe

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.