I have two machines running Ubuntu 22.04 LTS. The first is a home server which is used for network attached storage using SMB. The second is a desktop, for which I want to create a permanent mount to the network attached storage.
I can connect to the network share using the Ubuntu GUI (below):
The problem with this approach is that some applications fail to write to the storage when it's mounted that way. Apparently I need to create a permanent mount point so that it's always mounted and authenticated.
I've been following this tutorial about how to do it
https://wiki.ubuntu.com/MountWindowsSharesPermanently
Steps Taken
Install cifs and setup mount point...
sudo apt install cifs-utils
sudo mkdir /media/storage
Create credentials file ~/.smbcredentials
...
gedit ~/.smbcredentials
Contents...
username=MY_SERVER_USERNAME
password=MY_SERVER_PASSWORD
domain=SERVER
Permissions...
chmod 600 ~/.smbcredentials
Note: I actually never know what domain refers to, do I just use "SERVER", which is the name of the machine, and that seems to work, but I haven't got the foggiest idea whether or not that's right.
Create entry in /etc/fstab
...
//SERVER/storage /media/storage cifs credentials=/home/user/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
At this point, I have my credentials set up, I have an entry in fstab, and Ubuntu recognises the share, but when I try to access it, I get this:
mount:cifs Permission Denied
No useful reason why I can't get access.
What I've Tried
Apparently SMB doesn't support sec=ntlm
anymore? So changing the entry in /etc/fstab/
to this almost works:
//SERVER/storage /media/storage cifs credentials=/home/user/.smbcredentials,iocharset=utf8,nofail 0 0
Now I can access the share, but I only have read access.
Questions
- How do I set up my permanent mount to the network share so that I have full read/write access?
- If
sec=ntlm
no longer works, how do I find out whatsec=
should be? - What should the
domain
entry in my credentials file be?