0

I have successfully mounted a samba share (from a Centos server) on my Raspberry Pi, but the share is read-only: sudo mount -t cifs //ip.address/sharename /mnt/test -o user=username,vers=1.0

I have also (with it unmounted) issued chmod 666 /mnt/test as I found reports that resolved the issue.

I can access the share read/write from Windows machines and linux machines. In fact, using the Raspberry Pi's File manager and putting smb://ip.adddress/sharename in the address bar, I can write to the folder without having it mounted.

I have tried shares on more than one machine and they all mount as read-only.

What have I missed in mounting the share that causes it to be read-only?

(most questions are about why a Raspberry Pi share is read-only. To be clear my issue is not with shares on the Raspberry Pi but accessing shares on other computers).

[Edit] This is the smb.conf on the server that I am trying to connect to:

[User]
        comment = User Files
        valid users = peter,powerpete,admin
        write list = peter,powerpete,admin
        path = /mnt/md0/shares/user/
7
  • What is the content of the smb.conf file? My guess is that guests are allowed but the named user in the mount is not detailed or been added to the samba users database.
    – user130616
    Mar 9, 2021 at 23:29
  • [User] comment = User Files valid users = peter,powerpete,admin write list = peter,powerpete,admin path = /mnt/md0/shares/user/ peter is the username I am connecting with. (Obviously there are carriage returns in there only they don't survive - I'll also add the extract on my post)
    – PeteC
    Mar 12, 2021 at 17:27
  • Did you add the users into the Samba user list using smbpassword? If so, did you give them a password? If so that's missing from your mount line...
    – user130616
    Mar 12, 2021 at 18:42
  • My server has the correct user (my Windows PC has no problem connecting). In my samba mount, it was user=peter. The mount then asks for the password (which I entered).
    – PeteC
    Mar 12, 2021 at 21:22
  • Sorry - did you add the user to smbpasswd with a password or not? (last comment spell corrected)... The issue maybe you are using sudo and user try -o username=user,password=pwd
    – user130616
    Mar 12, 2021 at 21:31

1 Answer 1

-1

maybe this will help you

cat /etc/samba/smbd.conf on my server:


[media]
path = /home/pi/shared/data/media
read only = no
public = yes
writable = yes
create mask = 0777
directory mask = 0777

then mounting script on my raspberry machine:

#!/bin/bash
sudo mount -t cifs -o uid=1000,gid=1000,user=pi,pass=`cat /home/pi/samba.cred` //server-IP-or-name/media /home/pi/shared/data/media

then the mounted share is fully read/write on raspberry on other machines - i.e. my Macbook - it works without even asking for user/password - just mount as Guest I have no Windows to check it

2
  • This looks like you are sharing files FROM a RPi to other machines, not connecting from a RPi to another server as I am trying to do.
    – PeteC
    Mar 12, 2021 at 17:39
  • from rpi1 to rpi2 Mar 13, 2021 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.