Score:0

How do I get write permissions on a samba share?

rs flag

I am trying to get write access to my Minecraft server with my windows 10 machine. Right now I only have read access. I am using a Ubuntu 22.04 server. Here is my current smb.conf:

[minecraft-files]
        comment = user Samba Share
        path = /home/user/mc-files
        read only = no
        browsable = yes
        writeable = yes
        create mask = 0664
        directory mask = 0775

permissions (Note that my username is 'user')

drwx------ 11 user user 4096 Jun 18 06:31 mc-files

Output of testparm -s:

Loaded services file OK.
Weak crypto is allowed

Server role: ROLE_STANDALONE

[global]
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:                                                                                                                                                             * %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        server string = %h server (Samba, Ubuntu)
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb


[printers]
        browseable = No
        comment = All Printers
        create mask = 0700
        path = /var/spool/samba
        printable = Yes


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers


[server-storage]
        comment = user Samba Share
        path = /home/user/server-storage
        read only = No


[minecraft-files]
        comment = user Samba Share
        create mask = 0664
        directory mask = 0775
        path = /home/user/mc-files
        read only = No

Output of ls -al /home/user/mc-files:

drwxrwxrwx+  9 user user 4096 Jun 18 07:03 ..
-rw-r--r--   1 9001 9001    2 Jun 18 06:33 banned-ips.json
-rw-r--r--   1 9001 9001    2 Jun 18 06:33 banned-players.json
-rw-r--r--   1 9001 9001  697 Jun 18 06:33 bukkit.yml
drwxr-xr-x   2 9001 9001 4096 Jun 13 01:36 cache
-rw-r--r--   1 9001 9001  104 Jun 18 06:33 commands.yml
drwxr-xr-x   2 9001 9001 4096 Jun 18 06:33 config
-rw-r--r--   1 9001 9001  158 Jun 13 01:36 eula.txt
-rw-r--r--   1 9001 9001    0 Jun 13 01:36 help.yml
drwxr-xr-x  11 9001 9001 4096 Jun 13 01:36 libraries
drwxr-xr-x   2 9001 9001 4096 Jun 18 06:32 logs

(There's more, but this should be enough)

I set the permissions to 700 because I set them to 777 before, until I found out that 777 is bad.

Any permissions or something in the config files that I need to change to get read and write access on windows 10?

I have looked at similar questions to this one, but those are very old questions and in different versions of ubuntu.

Luuk avatar
cn flag
Please read about permissions on linux (for example: [Linux file permissions explained](https://www.redhat.com/sysadmin/linux-file-permissions-explained)). After reading you will know why this: "**I set the permissions to 700 because I set them to 777 before, until I found out that 777 is bad.**" is the cause of this behaviour.
Morbius1 avatar
es flag
Not enough information provided to answer the question. Please edit your original post and add the output of the following commands: `testparm -s` and `ls -al /home/user/mc-files` If you have a lot of files in mc-files the first 10 lines or so from the ls -al command is enough.
mpboden avatar
do flag
Did you add `user` as a Samba user? Your Samba share doesn’t list any valid users. If you want to restrict access to valid users only, then add `valid users = user`. Finally, the Unix permissions on the filesystem need to allow read/write access for that user. Read more about Samba Users and Security [here](https://www.samba.org/samba/docs/using_samba/ch09.html).
Morbius1 avatar
es flag
uid = 9001? Is this in a Docker container? You might want to look at the last comment here and the link within it to see if this applies: https://forums.tomshardware.com/threads/cant-use-samba-on-a-docker-folder.3761764/
I sit in a Tesla and translated this thread with Ai:

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.