How to permanently mount password-protected samba share with workgroup
Change your ~/.smbcredentials
user=myUser
password=pass
domain=WORK
That's all ;)
The problem occurs when you use the user name and the domain name together.
And please revert the changes for ~/.smbcredentials
chmod o-rwx,-x ~/.smbcredentials
Related videos on Youtube
![quant](https://i.stack.imgur.com/lAhj3.png?s=256&g=1)
quant
I'm here to learn programming and *nix mostly, and am immensely indebted to this community for always being there when I get stuck. The help and support I've received on SE sites has allowed me to develop my understanding in a range of disciplines much faster than I could ever have hoped for. I try to give back once in a while as well; it's the least I could do. I'm the owner and maintainer of www.portnovel.com
Updated on September 18, 2022Comments
-
quant almost 2 years
I can use the following command to log into a samba share on my network:
smbclient -L //host.name.com -U myUser --workgroup=WORK
where
myUser
is my username andWORK
is the name of the workgroup. I can also access this share via Places->Connect to Network without issues.However, I can't mount the drive permanently. Here's what I did after following the Ubuntu instructions on mounting a sambda share permanently:
I have created a file called
~/.smbcredentials
and runchmod 600 ~/.smbcredentials
:user=WORK/myUser password=pass
(where
pass
is my password)I have also added the following line to my
/etc/fstab
://host.name.com/ /media/share cifs credentials=/home/myUser/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
I have also run
sudo mkdir /media/share
.However, when I run
sudo mount -a
I see the following:mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
What am I doing wrong?
-
FreeSoftwareServers almost 9 yearsWhat are permission of /media/share directory. Try chmod 777 just to troubleshoot
-
quant almost 9 yearsI ran
sudo chmod 777 /media/share
, same result. -
quant almost 9 yearsI tried
chmod 777 ~/.smbcredentials
as well.
-
-
quant almost 9 yearsNice one. Could you explain how you found this information?
-
quant almost 9 yearsOk good enough for me :) I'll award the bounty once I'm allowed.