Search:

PmWiki

pmwiki.org

edit SideBar

Main / Samba

Just Getting It Working

Install it and then edit /etc/samba/smb.conf.

At the bottom add:

[winshare]
path = /path/to/dir
available = yes
browsable = yes
read only = no
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777

Where winshare is the name of the share. Then run service smbd restart. Connect on windows to \\serverip\winshare.

If you continue to have write problems, then set force user = <linuxuser>.

Limited Access

Create a user group called smbgrp and a new Linux user and smb user. Add primary Linux user to the smbgrp. Assign the smb user and group as owners of the share directory.

[lin-winshare]
path = /path/to/dir
available = yes
valid users = @smbgrp
browsable = yes
read only = no
writable = yes
guest ok = yes
public = yes
force user = winshares
create mask = 0775
directory mask = 0775
write list = winshares ts

You can set the required protocols and limit access FROM specific machines with:

### GLOBAL adds to give Windows access privately ###
  min protocol = SMB2
  max protocol = SMB3
  client min protocol = SMB2
  client max protocol = SMB3
  client ipc min protocol = SMB2
  hosts allow = 10.0.10.159/24

If you haven't added your user to the Samba group, you'll want to add your user to become a samba user with smbpasswd -a <username>.

Nobody actually ever mentions this, but you also need to restart both machines. This will fix any group membership and permissions issues for your users on the Linux side, clear out the network mappings and allow fresh authentication to work on the Windows side.

Other Tips

testparm is a neat utility that will run through your smb.conf and find problems.


Page last modified on October 24, 2024, at 04:17 PM