I recommend to create a dedicated user for that share and specify it in force user(see docs).
Create a user (shareuser for example) and set the owner of everything in the share folder to that user:
adduser --system shareuser
chown -R shareuser /path/to/share
Then add force user and permission mask settings in smb.conf:
[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser
Note that guest ok is a synonym for public.
I recommend to create a dedicated user for that share and specify it in force user(see docs).
Create a user (shareuser for example) and set the owner of everything in the share folder to that user:
adduser --system shareuser
chown -R shareuser /path/to/share
Then add force user and permission mask settings in smb.conf:
[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser
Note that guest ok is a synonym for public.
In the share settings in smb.conf, you'll need to specify the names of users and/or groups that are allowed to write to the share, using a write list = ... line.
Example:
[myshare]
...
write list = my_linux_username
Then you'll need to use the smbpasswd command to set up a password to authenticate my_linux_username for Samba:
sudo smbpasswd -a my_linux_username
This step is necessary because the standard system passwords in /etc/shadow are hashed in algorithms that are incompatible with the password hash algorithms used in the SMB protocol. When a client sends a SMB authentication packet, it includes a hashed password. It can only be compared to another password hash that uses the same algorithm.
(Very, very old instructions from the previous millennium may recommend disabling password encryption in Samba, and using certain registry hacks to allow Windows to emit unencrypted passwords to the network. This advice is obsolete: those registry hacks may no longer work in current versions of Windows, and allow anyone who can monitor your network traffic to trivially capture your password.)
There's one more thing you may have to do client-side. When your Windows client system is joined to an Active Directory domain and you're logged in with an AD account, it automatically prefixes all unqualified usernames with the name of the AD domain of the user, i.e. you will be authenticating as AD_DOMAIN\your_username, not just your_username.
If you are logged in with a local account (or your client system is not joined to an AD domain), Windows may automatically prefix the username with the client hostname unless you specify another domain name.
To successfully log in to a stand-alone Samba server from a stand-alone Windows client, you may have to specify your username as SAMBA_SERVER_HOSTNAME\your_username.
Otherwise Samba will see the username as WINDOWS_CLIENT_HOSTNAME\your_username, conclude that it has no way to verify any users belonging to domain named WINDOWS_CLIENT_HOSTNAME, and will reject the login.
(Newer versions of Samba may have a built-in check for this specific situation, and they might allow you access nevertheless. But this is basically how SMB authentication works "under the hood", and if you need to deal with old versions of Samba, it might be useful still.)
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...
I am so close to having this set up, I just need a little help with the last steps. I set up a samba share on my Proxmox server using this tutorial:
https://computingforgeeks.com/how-to-configure-samba-share-on-debian/
From my Windows PC I can see the Proxmox server on the network, I can login and see the demo files I created in the tutorial, but I can’t make any changes. Just keeps saying I don’t have permission. I have Plex in an LXC. From Windows I need to be able to navigate to the hdd and add media files over the local network. I thought I enabled write permission, but maybe I missed something.
Can someone please help me figure this out?
Remove samba by executing following commands
sudo apt-get remove --purge samba
sudo apt-get remove --purge smbclient libsmbclient
sudo apt-get purge samba samba-common
sudo rm -rf /etc/samba/ /etc/default/samba
Install it again
sudo apt-get install samba
sudo apt-get install smbclient libsmbclient
Now original smb.conf has been restored so restart Ubuntu then add user from terminal.
root@Dell-Inspiron-3521:~# sudo smbpasswd -a username (username should be without space eg "sudo smbpasswd -a alamjitsingh")
New SMB password:*********
Retype new SMB password:*********
Added user alamjitsingh.
Now edit smb.conf file as follows. Mentioned lines must be present in the the code.
sudo gedit /usr/share/samba/smb.conf
[global]
workgroup = WORKGROUP
passdb backend = tdbsam
security = user
[Optional] If you want to share folder which are inside opt directory then you also have to add following line in global section.
usershare owner only = False
In authentication section turn "map to guest = bad user" off by adding # at starting of code
#map to guest = bad user
At last add your personal code
[sqr_custom]
path = /opt/oracle/psft/pt/ps_home8.55.11/sqr_custom
comment = Personal_Share
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = yes
printable = no
locking = no
strict locking = no
Apart from this your shared folder is in opt folder which require permissions to write. So firstly test this prog by sharing folder of home directory. Then we will proceed further. To know correct path of shared folder drag and drop folder on running terminal.
If you are succeed to run above code then do the following
To create a group:
sudo groupadd demoGroup
To add the user account to the group:
sudo usermod -G demoGroup username(eg alamjitsingh)
For setting permissions of writing
sudo chown -R username:groupname /opt/demo
eg
sudo chown -R alamjitsingh:demogroup /opt/demo
Following lines are for granting the write access to members of the demoGroup in directory demo (It will grant all demoGroup members to write)
sudo chgrp -R demogroup /opt/demo
sudo chmod 2770 /opt/demo
Restart services
sudo service nmbd restart
sudo service smbd restart
eg of shared folder of restricted directory with write privilege
[demo]
path = /opt/demo
comment = HD Share
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = yes
printable = no
locking = no
strict locking = no
force create mode = 0660
force directory mode = 2770
force user = alamjitsingh
force group = demogroup
Try below mentioned code
[global]
workgroup = WORKGROUP
netbios name = CDA
passdb backend = tdbsam
security = user
#map to guest = Bad User
username map = /etc/samba/smbusers
guest account = nobody
guest ok = yes
log file = /var/log/samba.log.%m
log level = 2
max log size = 1000
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printing = bsd
[custom_home]
path = /opt/asdf/custom_home
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = yes
locking = no
strict locking = no
create mask = 0777
directory mask = 0777
valid users = @writer (if writer is not username remove this line i think, you added user name = testuser so remove this line)
Most probably testuser is your user name to access this shared folder. In windows 10 you have to "Add a Network Location" manually, eg- "\\192.168.1.3\ Shared_folder_name" then it will ask for username and password. Find this option->Add a Network Location in windows 10. In android devices you can access this shared directory via "ES file explorer" app. If still not working intimate me. Good luck.
The problem is the config line:
vfs objects = catia fruit recycle streams_xattr
Note the requirements of the VFS module streams_xattr:
The file system that is shared with this module enabled must support xattrs.
After removing streams_xattr at least writing once worked. However deleting and writing again made problems. Removing fruit alltogether, although using samba only from a mac client, made file operations work as expected.
I am also using dperson/samba with a exFAT mount, and was having similar issues with a Windows 10 client giving this error whenever I tried to rename/move/delete (but creating files worked)
Error 0x80070032: The request is not supported.
as you said, the fix was to remove fruit and streams_xattr from vfs objects line in /etc/samba/smb.conf
vfs objects = catia recycle
$ docker exec -it samba bash
$ vi /etc/samba/smb.conf
# in vi, delete fruit and streams_xattr from vfs objects =
$ exit
$ docker restart samba