I'm running ChaletOS 16.0.4.2. I did everything I could find online to get access to an external drive shared through an Asuswrt-Merlin router. NOTHING! I MEAN NOTHING WORKED!! Once I installed all of the necessary samba stuff, I still could not access my share. I kept getting the prompt to enter my password. I'd enter it correctly but got no joy. Once I made Peter de Maeyer's change in "/etc/samba/smb.conf" above, the drive opened up like blue skies after a heavy rain. Thanks Peter!!!
Since I never found all of these steps in one place, I hope this might help someone else. What finally did the trick was a combination of Peter's response and this link.
To summarize, I first created the "~/.smbcredentials" file and put the relevant info inside:
(For the unfamiliar, that little wiggly character in front of the "/" means to place the file in your "/home" folder)
username=msusername
domain=ENTER_YOUR_WINDOWS_DOMAIN
password=msusername
(The site doesn't say to add the domain, but I did so just for good measure)
I saved and closed that file and changed permissions for it by entering this in the terminal:
chmod 600 ~/.smbcredentials
Next, I edited the "/etc/fstab" file by entering this in the terminal:
sudo gedit /etc/fstab
In the "fstab" file I entered this at the bottom (make sure you use your own information here):
smb://COMPUTER_NAME/SHARED_FOLDER /media/NEW_FOLDER_NAME cifs credentials=/home/YOUR_UBUNTU_USERNAME/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
I saved and closed that file and then opened the "smb.conf" file by entering this in a terminal:
sudo gedit /etc/samba/smb.conf
On Line #29 (Under "Global") I changed the "workgroup" name to match the "domain" name above. Immediately under that I created a new Line (Line #30) and entered:
client use spnego = no
Just in case, after reading this site, I thought it would be a good idea to also make this change on Line #101:
obey pam restrictions = yes to obey pam restrictions = no
After more than twenty (yes, that's 20) hours and hours of searching and borking my system several times, I finally found joy with these settings.
Good luck and may the Linux Gods be with you!