Mount SMB share via CLI gives no write permission

I am a very basic user, but I have managed to use Dolphin to mount an smb share in my network, using a seperate username and saving that in the keychain. I then have full write permissions within that share.

I need to mount it for other applications, so I have tried this command:

mount -t cifs -o username=sambauser //192.168.x.x/Folder /run/media/Folder

It then asks the password and mounts the share to the specified folder, but I get read-only access. It is the same username and password I use when mounting the share in Dolphin.

This user has permission 770 on the server for this share/folder.

After I get this temporary mount working, I would like to enter this share in fstab. Right now, I have the same problem using fstab to mount this share - read-only.

Any help is appreciated!

There is a gazilion topics on samba …

This is a volatile folder that do not exist prior to the mount - possibly why you get readonly.

sudo mkdir /data/folder
sudo mount -t cifs -o username=sambauser //x.y.z.ip/Folder /data/folder

If you samba share is on a Linux server - you should definately look at your permissions on the service and your mountpoint.

1 Like

Oh yeah, sorry, I created the folder ahead of time.

Still the /run/media - is readonly - and your actions are unpredicatable.

That won’t work - /run/media is volatile and is recreated on every system start.

See → above Mount SMB share via CLI gives no write permission - #2 by linux-aarhus

 $ ls -la /run/media
total 0
drwxr-xr-x  2 root root   40 28 maj 16:40 .
drwxr-xr-x 40 root root 1080 10 jun 15:54 ..

If you need a - on the fly mount - you could use something like
this → [root tip] [Utility Script] GIO mount samba share

Another topic on basic sharing is
this → [root tip] [How To] Share and Access NTFS devices using Samba

Mounting a network share in /etc/fstab can cause unexpected errors and delays on boot.

Ok, so first I want to understand the temporary, manual way of mounting and once that works, I will try to use systemd, following the guide you linked.

If I understand you correctly, /run/media is not a place to do this because this folder is created dynamically on boot. I tried /home/linuxuser/remote/Folder instead, so I created this and as local root, mounted the share using the mount command.

Now, when I open the folder in Dolphin, things like “New Folder” are not greyed out as they were previously, but I still get an error message upon attempting any write command.

Meanwhile, in the Dolphin-mounted share I can create folders and write and so on. I am really trying to use guides before asking questions, but I’m out of my depth for this.

I found the solution:

I had to add “uid=linuxuser” to the options, that way my local user gets write permissions to the mounted share. If I don’t add that, only root has write access.

sudo mount -t cifs -o uid=linuxuser,username=sambauser //192.168.x.x/share /mnt/folder/

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.