After hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault.
So, if I change my share name in smb.conf from:
[Music]
to
[Tunes]
I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.
Answer from the_meter413 on askubuntu.comAfter hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault.
So, if I change my share name in smb.conf from:
[Music]
to
[Tunes]
I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.
Under linux, you need to map your system account to the samba server account.
If you are creating a new user for samba access, then enter the following commands
sudo useradd {user}
sudo passwd {user}
To map a system account to a samba user use the following command
sudo smbpasswd -a {user}
The edit the file /etc/samba/smbusers to map the system account to the samba account, where the system account references the samba account
user = "user"
for what it is worth, I couldn't access my samba share, maybe you have forgotten to add you username to the samba password group (for lack of beter description phrase)
this is what I did to get mine to work
smbpasswd -a username
after by using nautilus, shared my drive/folder with right-click, sharing, etc.
create your password, and use your username and passsword (which you just entered) to access your samba drive, you can also map this drive in Windows
hope this could help
Are the group and owner of the shared folder set properly for the samba user? Should be the same, or try
$ chown -R nobody:nogroup sharedfolder
for testing purposes...
debian - Can't make samba share writable - Unix & Linux Stack Exchange
permissions - Samba (Cannot Write) issue - Stack Overflow
Can't write to samba share on Windows 11 despite changing the samba config
readwrite - Can't Write to Samba Share - Raspberry Pi Stack Exchange
Videos
Ok, figured it out. It wasn't in my samba settings. The error was actually in how I was "permanently" mounting my samba share.
I was doing:
//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD 0 0
but I needed
//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD,file_mode=0777,dir_mode=0777 0 0
Adding both file_mode and dir_mode solved it.
The difference in owner printout is probably due to different UID/GID you have on your local and remote machines.
You can use noperm option at mount instead (no need for file_mode or dir_mode). This option turns off the local file permission check (so UID/GID inconsistency will be okay) and assume the remote identity you authenticated at mount. Remote access control is still enforced.
Basically I have 4 hard drives that I have mounted in a USB dock that's connected to my Proxmox box and passed through to Ubuntu server. For some reason when I mounted the drive, I can see it but it refuses to let me write to it.
I'm open to other ideas if there's something better. Not looking to use TrueNAS or anything else like that due to the fact that it cannot see all 4 of the drives from that stack. Ideally I'd stick with Ubuntu server. I have considered SFTP, but was hoping to get samba shares up for simplicity so my SO can use it without frustration.
Here's what I have setup so far after reading a handful of different stack overflow suggestions, none of them worked.
Hey there!
Currently, I can read and execute from the share, but am unable to write to the share. I can write when using the CLI on the server itself, but cannot write when using the share from the client.
I am using Samba 4.13.13-Debian on a Debian 11 server. This is my /etc/samba/smb.conf on the server:
[global]
server role = standalone server
map to guest = never
usershare allow guests = no
hosts allow = 127.0.0.1 192.168.1.0/24
hosts deny = 0.0.0.0/0
security = user
ntlm auth = true
[share]
comment = root
path = "/root/svr_storage_main/"
read only = no
browseable = yes
writeable = yes
create mask = 0777
directory mask = 0777
guest ok = no
force user = alex
force group = alex
valid users = alex And my /etc/fstab on the host that mounts the share:
{SHARE_PATH_REDACTED} /home/alex/svr_share cifs username=alex,password={PASSWORD_REDACTED},file_mode=0777,dir_mode=0777 0 0 The permissions for both the root folder of the share on the server and the root folder that the share is mounted to on the client has been set recursively to drwxrwxrwx as well.
Is there any reason that you can see why this may still not allow me to write to the share?
EDIT: formatted code block section for readability.
Greetings all,
I am fairly new to this, so please accept my apologies in advance :P
So I have debian12 running in a VM (proxmox), I have several apps running like heimdal, immish, emby... that sort of things.
I am trying to install manyfold, but the container apparently needs read permissions, except my files are stored on a synology nas (samba share).
root has access, no problem, but when I switch to my normal user, indeed, I can't write in those folders.
This is my FSTAB : as you can see I have several folders mounted, but I can't write in any of them. There is read/write permissions for the user "batuu" on my synology nas. I tried to mount 3Dfiles with 2 different lines, but no dice so far.
Halp !
startide@halcyon:/media/share$ nano /etc/fstab GNU nano 7.2 /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # systemd generates mount units based on this file, see systemd.mount(5). # Please run 'systemctl daemon-reload' after making changes here. # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=5cc0304f-07ea-4b83-bc7e-298a7cd6b190 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=0b652e05-ecff-4e01-b28c-1f0191ee7100 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 #network share for emby //192.168.1.25/movies /media/share/movies cifs username=batuu,password=redacted 0 0 //192.168.1.25/series /media/share/series cifs username=batuu,password=redacted 0 0 #network share for himlish //192.168.1.25/photos /media/share/photos cifs username=batuu,password=redacted 0 0 #network share for manyfold # //192.168.1.25/3Dfiles /media/share/3Dfiles cifs uid=1000,gid=1000,username=batuu,password=redacted,uid=1000,gid=1000 0 0 //192.168.1.25/3Dfiles /media/share/3Dfiles cifs guest,uid=1000,username=batuu,password=redacted,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
EDIT: Solved. cleared Samba cache and configs worked.
I've been running a share on a raspberry pi for a while, and moving it to a more modern machine with Mint 22.
I started by creating users and groups.
#ensure clean users/groups
sudo deluser --remove-home guest > /dev/null 2>&1
sudo deluser --remove-home general > /dev/null 2>&1
sudo groupdel smbgroup > /dev/null 2>&1
sudo addgroup smbgroup
fnuseradd () {
username=$1
sudo useradd -m -G smbgroup -p $(openssl passwd -1 ${username}) ${username}
sudo chage -I -1 -m 0 -M 99999 -E -1 ${username}
echo -e "${username}\n${username}" | smbpasswd -a ${username} -s
}
#create guest/general, auto set passwords
fnuseradd guest
fnuseradd general
#prep mount location
mkdir /home/general/shares
mkdir /home/general/shares/major
chown -R general:general /home/general
chmod -R a+rwx /home/general#mounted my large drive in fstab to /home/general/shares/major
#/dev/disk/by-uuid/2ced2f3d-e8e6-4ba1-b89f-94d5f411b9e5 /home/general/shares/major auto nosuid,nodev,nofail,x-gvfs-show 0 0
#samba conf without comments [global] workgroup = WORKGROUP server string = %h server (Samba, Ubuntu) log file = /var/log/samba/log.%m max log size = 1000 logging = file panic action = /usr/share/samba/panic-action %d server role = standalone server obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes [printers] comment = All Printers browseable = no path = /var/tmp printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no [major] comment = Library path = /home/general/shares/major browsable = yes writeable = yes valid users = guest general write list = general create mask = 0777 directory mask = 0777
sudo systemctl restart smbd nmbd
So I can browse the share with user general, but I cannot write to it - can't create files/folders.
This isn't just from my remote windows machine, it's also local.
root@BeoBalthazar:/home/general/shares/major# smbclient //localhost/major -U general Password for [WORKGROUP\general]: Try "help" to get a list of possible commands. smb: \> mkdir test NT_STATUS_ACCESS_DENIED making remote directory \test smb: \> ls . D 0 Sun Mar 2 13:07:36 2025 .. D 0 Sun Mar 2 13:07:36 2025 13563583456 blocks of size 1024. 12879948040 blocks available smb: \>
Any idea why I can't write?
Figured it out.
current share block hasn't changed much:
[major]
path = /home/general/shares/major
browsable = yes
writable = yes
valid users = general, guest
write list = general
issue was related to samba cache
sudo rm -rf /var/cache/samba/*
sudo rm -rf /var/lib/samba/*.tdb
ACL issues (ie. massive PIA) on the share?