1

I have been struggling with getting a shared Samba share in Linux to be writable from Windows 10/11. I have found several questions on this but can't find a solution. I can see and list the samba share without any issues, simply can't create or write files. Tested on 2 different Windows machines.

I did have this setup working a few years ago and if memory serves I had to install additional features in windows and a couple of tweaks in the smb.conf but not sure what those were. I have tried mounting the HDD using both ntfs-3g and cifs, using the uid and gid for a user I created for samba shares netuser, included force user = netuser, setting fmask=000, dmask=000, and rw, all with no luck.

One thing I noticed when looking at the permissions from windows it shows the owner as netuser, Everyone has only Special Permissions and looking at the Advanced Permissions shows Access with Full control.

My current fstab

/dev/sda1 /mnt/sda1 ntfs-3g x-gvfs-show,dmask=000,fmask=000,rw,uid=1001,gid=1001 0 0

Samba Config

[PublicFiles]
path = /mnt/sda1/Public
guest ok = yes
browseable = yes
read only = no
writable = yes
create mask = 0777
directory mask = 0777

I realize this setup is insecure (testing only), once I find the problem I can tighten things back down. I have not added any Windows Features, are there any I need to check to enable write permissions?

I know there has been a lot of changes, especially in recent years, is Samba still the way to set this up? I have seen NFS thrown around quite a bit but I am not familiar with it. Figured Samba would be easiest way to get this setup done since it's simply for internal file sharing/organization. I would be open to other ways to get this working if need be.

1 Answer 1

0

There are two ways I use:

(1) In Linux: \\192.168.x.y\folder where this is the IP of the Windows Machine

(2) In Windows: Implement Samba on Linux.

Follow this tutorial

Samba Tutorial

  1. Installing Samba

In the Linux machine, install Samba .

sudo apt update
sudo apt install samba

Use whereis samba to verify the install.

  1. Setting up Samba .

Make a directory to share: mkdir /home//sambashare .

Edit the smb.conf file: sudo nano /etc/samba/smb.conf .

Add the following lines at the bottom of the file:

[sambashare}
comment = Samba on Ubuntu
path = /home/<username>/sambashare
read only = no
browsable = yes

Ctrl-O to save and Ctrl-X to exit the editor .

Restart the samba service: sudo service smd restart .

Update the firewall rules if necessary: sudo ufw allow samba .

Setting up User Accounts and Connecting to Share

sudo smbpasswd -a and password

(username must belong to a system account or it will not work)

In Linux:

smb://ip_address_of_Linux/sambashare

2
  • Thank you, I was able to get the share to show up and everything, I can see the files from windows, only problem is I can't seem to be able to write from windows. Commented Mar 9, 2023 at 13:57
  • Are your account credentials correct according to the tutorial. No issue here transferring files (so writing) between Windows and Ubuntu.
    – anon
    Commented Mar 9, 2023 at 16:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .