You are not logged in.

#1 2017-02-12 01:20:52

capncrunch
Member
Registered: 2016-04-27
Posts: 11

Need help setting up Samba

I am trying to get Samba working properly to share files from my Bunsen machine to Windows machines on my LAN, but am having some difficulty. I get prompted for user authentication when attempting to access the share from a Windows machine, but the credentials are not being accepted. I'm hoping someone might be able to help as I'm not sure where in my configuration I'm going wrong. Here's what I have so far:

# addgroup smbgrp
# adduser --ingroup smbgrp --no-create-home --shell /bin/false shareuser
# passwd shareuser
# smbpasswd -a shareuser
# cd /mnt/external/WD2TB1/
# chown -R myuser:smbgrp * .*

In /etc/fstab I have the following line. The uid is my primary user. The gid is the ID of smbgrp from above. I'd like to have ownership of the files under my user, and at the same time to be accessible to any member of the smbgrp.

UUID=57453DFC27C4C798	/mnt/external/WD2TB1	ntfs-3g	uid=1000,gid=1003,dmask=027,fmask=027	0	0

smb.conf contains:

[global]

   workgroup = WORKGROUP
   dns proxy = no
   security = user
   printing = bsd
   printcap name = /dev/null

#### Networking ####

;   interfaces = 127.0.0.0/8 eth0
;   bind interfaces only = yes

#### Debugging/Accounting ####

   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d

####### Authentication #######

   server role = standalone server
   passdb backend = tdbsam
   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

########## Domains ###########

;   logon path = \\%N\profiles\%U
;   logon drive = H:
;   logon script = logon.cmd

; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

;   include = /home/samba/etc/smb.conf.%m

;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

;   usershare max shares = 100

   usershare allow guests = no

#======================= Share Definitions =======================

[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S

;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[Music]
   comment = Music Archive
   path = /mnt/external/WD2TB1/Music
   user = @smbgrp
   browseable = yes
   guest ok = no
   read only = no
   writable = yes

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
;   write list = root, @lpadmin

--- Mod edit: added [ code ] tags for readability wink ---

Last edited by damo (2017-02-12 10:37:40)

Offline

#2 2017-02-13 15:50:40

Kino
Member
From: Stockport, UK
Registered: 2016-04-30
Posts: 109

Re: Need help setting up Samba

Well, if it's any consolation I've always had problems setting up samba. My home network consists of several pc's running Windows/BL/Ubuntu and not all dual-boot.

However, once I've decided that my smb.conf file is okay then it's a case of opening a terminal and typing:

sudo smbpasswd -L <username>

you will be prompted for a password so enter one
and then

sudo smbpasswd -a <username>

to enable the user.
Finally stop & restart samba

sudo service samba stop
sudo service samba start

That's all the advice I can offer.

Offline

Board footer

Powered by FluxBB