Score:0

21.10 - Unable to write to Samba share without SU in Ubuntu. Windows can write using the exact same Samba credentials

ru flag

Relatively new to Ubuntu. 21.10. Stuff I've tried so far:

I have seen other threads regarding this and have made sure the Samba share names and folder names do not match. Folder actual name: nasdrive | Share: 4tb | Mount point: nas

Mounted via fstab. Using credentials stored in a local file, ~/.smbcreds, which is called in fstab.

Windows can read/write without any issues whatsoever, when using the exact same samba credentials.

Ubuntu can write to the share ONLY from console via sudo touch /media/nas/testfile

fstab entry: //192.168.50.56/NASdrive /media/nas cifs vers=3.0,credentials=/home/username/.smbcreds

The .smbcreds file is as follows:

USERNAME=user

PASSWORD=P@s5w0rd

The Samba share is hosted from a Raspberry Pi. It's a physically separate machine from the computer attempting to write.

in flag
Is the Samba share on the same Ubuntu machine or hosted elsewhere? Can you [edit] your question to include the `fstab` line?
ru flag
Hey @matigo - made the requested updates. Thanks for checking this out.
Score:0
es flag

CIFS will mount a share with owner = root and permissions of 755 so only root will be able to write to the share on the client.

One way to fix this is to replace root with you so you become the owner. You do that by adding uid=username ( where username is your local login user name ) to the list of options.

Change this:

//192.168.50.56/NASdrive /media/nas cifs vers=3.0,credentials=/home/username/.smbcreds

To this:

//192.168.50.56/NASdrive /media/nas cifs uid=username,vers=3.0,credentials=/home/username/.smbcreds
ru flag
Brilliant. This did the trick. Thanks for sharing your expertise!! I'd vote you up but you apparently need 15 rep to do that and I have no idea how to acquire it.
AbdulKarim avatar
la flag
This worked for me as well, The weird part that I tried to edit using sudo some of the file contents it did not work. Never expected this was the solution !
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.