Let's take just the first share as an example - and here I'm correcting the read-only = yes line:
[Fr-data]
path = /free/fr/data
read only = yes
valid users = @global
write list = borhacker
force create mode = 0775
force directory mode = 0775
create mask = 0775
directory mask = 0775
The only user that will gain access to the folder being shared is borhacker. Not becase of the share definition in smb.conf but becase the parent folder only allows that user access. In fact borhacker is the only user that can access any of these shares for the same reason.
This represents the Linux permissions on /free/fr:
drwxrwx--- 15 borhacker borhacker 15 Dec 19 12:39 .
You need to allow users other than borhacker the ability to traverse the /free/fr folder:
sudo chmod 775 /free/fr
A samba share definition cannot override the Linux permissions of the folder being shared or the Linux permissions of the path to that folder
Answer from Morbius1 on askubuntu.comsamba - permission denied when share in another users home directory - Unix & Linux Stack Exchange
Samba doesn't work : permission denied when using smbpasswd
SAMBA Permissions not matching linux permissions?
Samba: Permission Denied
Logged into the server with a bash prompt as my domain user, I'm able to move around the files as expected. It's only when accessing it over samba, both windows and another linux vm, that I'm getting permission denied moving the files.
I think it's samba specifically, since I'm also mounting the fs from a linux vm and it's giving me the same behaviour.
The only workaround we have right now is to add our usergroup as admin in the smb.conf to get permissions.
Any ideas?
(Sambas support is only through a broken mailing list atm, so thought i'd ask here. ^^)
Thanks!
To access the samba share, please pay attention to:
- You had to create a system user with the same username. In this case, please issue the following command:
useradd -s /sbin/nologin benjamin - If you are using a SELINUX-enabled system (eg: CentOS), try to temporarily disable it issuing
setenforce 0
EDIT: as the problem persists, try the following:
- maybe your Windows host is prepending your username with the wrong domain name. From the Windows machine, try to login using
localhost\benjaminas the username - issue
pdbedit -Land check if userbenjaminis listed. If so, set a trivial password (you can change it later) usingsmbpasswd benjamin - if user
benjaminis not listed, try to recreate it issuingsmbpasswd -a benjamin - if it does not work, delete the passwd file (it is named
passwd.tdb; for reference, in a CentOS 6.x system it is found under/var/lib/samba/private/). Then, recreate your user issuingsmbpasswd -a benjamin - if it still not working, try to use the root account issuing
smbpasswd -a rootand check if you can login using the root user. Note: this is only a try. After having done with it, you must delete root's entry issuingsmbpasswd -x root - Your last resort is to increase the verbosity of logging and see if you can find clues there. For authentication attempts, edit or add the following line on your smb.conf
log level = 2 winbind:5, check the logs with something liketail -f /var/log/samba/log*and try to login.
It is possible you need to add the user in question to your smb service in linux
sudo smbpasswd -a myuser
I can't fedora 31's shares from Windows & another fedora box as it keeps returning with "permission denied" from both the windows & linux box. I have tried changing the permissions of the share drive and changing the smb config file. My goal is mount hard drives in the /mnt/ directory and share them to the network, but right now, I am only testing a normal directory outside of the mounted hard drives. I know I am missing something extremely basic with creating a simple samba share, but for the life of me, I can't figure it out. Any advice would be greatly appreciated. Thank you!
error message from Linux
sudo mount -t cifs -o username=lowao //ip.address/work /mnt/work
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
error message from windows
Permission not granted or something like that
ls -ld /mnt/drive
drwxrwxrwx. 2 lowao lowao 4096 Nov 22 18:52 /mnt/drive/
/etc/samaba/smb.conf
[drive]
comment = Samba
path = /mnt/drive
writeable = yes
browseable = yes
create mask = 0777
directory mask = 0777
guest ok = no
public = no
share modes = yes
valid users = %Ssmbd logs || nmbd logs
smbclient -L ip.address
Sharename Type Comment
--------- ---- -------
work Disk Samba
SMB1 disabled -- no workgroup available
Samba setup
systemctl enable smb nmb
firewall-cmd --add-service=samba --permanent
firewall-cmd --reload
setsebool -P samba_enable_home_dirs on
useradd -m lowao
pdbedit -a lowao
chmod 0777 /mnt/work
chcon -R -t samba_share/_t /mnt/work
/etc/fstab
# Windows work
UUID=2460DCC960DCA33A /mnt/work ntfs permissions,locale=en_US.utf8 0 2
[Mounting nfts hard drives in /mnt/. These are the partitions I would like to mount and share at some point.]Solution: Something within the original smb.conf screwed with permissions. Wipe it out and try the following. [global] unix charset = UTF-8 workgroup = WORKGROUP security = user hosts allow = 127. 10.0.0.
[Share01]
path = /home/share01
writable = yes
guest ok = no
valid users = @smbgroup01
force create mode = 777
force directory mode = 777
inherit permissions = yeshttps://www.server-world.info/en/note?os=Fedora_31&p=samba&f=2
Hey! Trying to get Samba working on a bare metal, stock Ubuntu 24.04 machine. I'm able to connect to it from my Windows machine and read files, but if I try to write to it, it returns "Permission Denied". All the solutions I've found online involved problems with VM's or some other complicated setup, but this is as simple as it gets and I still can't get it up (user has been replaced, as it contains my full name)
[backups] comment = primary file storage path = /home/user/Files read only = no browsable = yes