Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

>Solution :

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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading