Can't write to SMB share from Ubuntu

Decoy256

Cadet
Joined
Mar 2, 2022
Messages
4
I'm trying to setup an SMB share, but having a little trouble writing to the share from my Kubuntu machine.

My main dataset is called "Vault" and then I have a child dataset "users", with a child dataset within "users", called "<MyNASUsername>". <MyNASUsername> is the dataset I'm trying to share. <MyNASUsername> is owned by <mynasusername> user and group, with permissions set for owner@, group@, and <mynasusername> all set to [Allow], [Basic], [Full Control], [Basic], [Inherit].

Under Shares, I have an SMB share setup, pointing to /mnt/Vault/users/<MyNASUsername>, with a share name of "<MyNASUsername>Home". The Share ACL is set to SID=S-1-1-0, Domain=[blank], Name=Everyone, Permission=FULL, Type=ALLOWED.

On by Kubuntu machine, I have a folder at ~/NAS<MyNASUsername> and I run

sudo mount -v -t cifs -o rw,vers=3.0,credentials=/root/.smbcreds //<local IP of NAS>/<MyNASUsername>Home ~/NAS<MyNASUsername>

My /root/.smbcreds contains

username=<mynasusername>
password=<mynaspassword>
domain=<local IP of NAS>

I can see the share and everything in it from my Kubuntu machine, but I cannot write anything to it and I'm not sure what I've done wrong. I've searched the forums and the internets looking for an answer, but no luck. Help would be greatly appreciated.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Decoy256 Change your mount command in Kubuntu. As it is, I think you'll find the mount point is owned by root:root not the desired user:group.

For example, if user and group id are both 1000:

mount -t cifs -o credentials=/root/.creds,uid=1000,gid=1000,file_mode=0644 //192.168.0.XX/grandchild /mnt

Then the mount point in Kubuntu "/mnt" will be owned by uid/gid 1000/1000

The command you used allowed the mount to succeed as the "authentication" was correct. But then your non-root use had no "authorisation" to do anything but view in Kubuntu.
 

Decoy256

Cadet
Joined
Mar 2, 2022
Messages
4
@Decoy256 Change your mount command in Kubuntu. As it is, I think you'll find the mount point is owned by root:root not the desired user:group.

For example, if user and group id are both 1000:

mount -t cifs -o credentials=/root/.creds,uid=1000,gid=1000,file_mode=0644 //192.168.0.XX/grandchild /mnt

Then the mount point in Kubuntu "/mnt" will be owned by uid/gid 1000/1000

The command you used allowed the mount to succeed as the "authentication" was correct. But then your non-root use had no "authorisation" to do anything but view in Kubuntu.
Thank you... I think you're onto something. Before I mount, the ownership of the local folder is <myusername>:<myusername>, but when I mount, the ownership changes to root:root.

So, I'm not sure changing ownership of the local folder will change anything, but why does it change owernship when mounted? Does this change your suggestion any?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Decoy256 Changing ownership of the local folder in Kubuntu before executing your original mount.cifs command will not solve your problem. That's easy enough for you to test. This ref: should explain why you need to add a uid/gid option to the mount command, as I suggested.


Any particular reason why you are not using dolphin to access your smb share(s)?
 

Decoy256

Cadet
Joined
Mar 2, 2022
Messages
4
Bingo! It worked! Thank you so much for walking me through that and helping me understand.

As for "using Dolphin" I assume you mean navigating through Dolphin to "Network" and then "Shared Folder (SMB)", correct? When I do that, it says "Unable to find any workgroups in your local network. This might be caused by an enabled firewall." I have no firewall enabled, so I'm not sure what the issues is. Under the SMB service, the netbios name is set to truenas and the workgroup is set to WORKGROUP.

If that is not what you meant by "using Dolphin", then I'm not sure.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Bingo! It worked! Thank you so much for walking me through that and helping me understand.

As for "using Dolphin" I assume you mean navigating through Dolphin to "Network" and then "Shared Folder (SMB)", correct? When I do that, it says "Unable to find any workgroups in your local network. This might be caused by an enabled firewall." I have no firewall enabled, so I'm not sure what the issues is. Under the SMB service, the netbios name is set to truenas and the workgroup is set to WORKGROUP.

If that is not what you meant by "using Dolphin", then I'm not sure.
That probably means it relies on the netbios name server. That said, I believe dolphin uses libsmbclient rather than the kernel SMB client. I prefer the latter.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Decoy256 You can ignore that error message and just type in the ip of your NAS, followed by the user creds when prompted. See below. It's true that in recent Kubuntu versions, and other kde distros, dolphin uses it's kio plugins for connection and mounting remote filesystems. Performance can be slower than using a linux kernel CIFS mount. The latest LTS release of Kubuntu is a few weeks away and the performance of dolphin + smb connections should be improved.

d1.jpg
d2.jpg
d3.jpg
d4.jpg
 
Top