Samba help for someone who is mostly clueless...

I installed samba419 and am trying to get it to function as a file share server to connect to from a Windows PC. I have an entire zpool I would like acces to called /nobackup. I tried to use the instructions for the basic authenticated access from this page:

This is what my smb.conf file looks like:
Code:
[global]
        log file = /var/log/samba/%m
        log level = 1
        server role = standalone server


[nobackup]
        path = /nobackup
        read only = no
        inherit permissions = yes
        valid users = Beer

I started the server with the following return:
Code:
service samba_server start
Performing sanity check on Samba configuration: OK
starting nmbd.
starting smbd.

Which look fine to me....
I've followed multiple tutorials at this point and am at a loss. Any and all help would be greatly appreciated.
 
I seem to be unable to connect to it. I try to and the network drive on Windows using the Samba login I configured but it's unable to. When I run the windows diagnostics it says the server is online but refusing the connection so I must have missed something somewhere.
I'm sorry for providing so little information but I'm also not great at procuring more...
Help on getting the information that is needed to solve the issue would also be greatly appreciated.
 
Is the server daemon running? You need to have a line 'samba_server_enable=YES' in /etc/rc.conf to start it automagically at boot. Try: $ service samba_server status
 
Is the server daemon running? You need to have a line 'samba_server_enable=YES' in /etc/rc.conf to start it automagically at boot. Try: $ service samba_server status
Okay so I already have the samba_server_enabled="YES" in my /rc.conf file but when I run the status command as my normal user (Beer) it's not running but on root it is:

Code:
Beer@ketflat1:~ % service samba_server status
nmbd is not running.
smbd is not running.
Beer@ketflat1:~ % su -
Password:
root@ketflat1:~ # service samba_server status
nmbd is running as pid 59238.
smbd is running as pid 60726.
root@ketflat1:~ #

I have no idea if this is normal or my issue
 
Maybe this will help
samba server troubles.png
 
You might want to start by reading the Handbook's chapter on setting up a Samba server:

I haven't played with Samba on FreeBSD in a while, but if you try to follow the Handbook step-by-step, you should have something going successfully. And that is usually a good starting point for making changes that are applicable to your situation.
 
Hmmm... I dont use this option, but in simple config at home I need to do
Code:
smbpasswd -a user
for adding user in samba.
Also, what shows
Code:
sockstat | grep smb
sockstat | grep nmb
So I added inherit permissions = yes, and set the password again as a sanity check but no luck.
Running the code you mentioned returns this:

Code:
root@ketflat1:~ # sockstat | grep smb
root     smbd        3264 4   dgram  -> /var/run/log
root     smbd        3264 6   dgram  /var/db/samba4/private/msg.sock/3264
root     smbd        2710 4   dgram  -> /var/run/log
root     smbd        2710 6   dgram  /var/db/samba4/private/msg.sock/2710
root     smbd        1987 4   dgram  -> /var/run/log
root     smbd        1987 6   dgram  /var/db/samba4/private/msg.sock/1987
root     smbd        1987 29  tcp6   *:445                 *:*
root     smbd        1987 30  tcp6   *:139                 *:*
root     smbd        1987 31  tcp4   *:445                 *:*
root     smbd        1987 32  tcp4   *:139                 *:*
root     smbd        1987 33  stream -> /var/run/dbus/system_bus_socket
root@ketflat1:~ # sockstat | grep nmb
root     nmbd       99547 3   dgram  -> /var/run/log
root     nmbd       99547 6   dgram  /var/db/samba4/private/msg.sock/99547
root     nmbd       99547 14  udp4   *:137                 *:*
root     nmbd       99547 15  udp4   *:138                 *:*
root     nmbd       99547 16  udp4   192.168.178.47:137    *:*
root     nmbd       99547 17  udp4   192.168.178.255:137   *:*
root     nmbd       99547 18  udp4   192.168.178.47:138    *:*
root     nmbd       99547 19  udp4   192.168.178.255:138   *:*
root     nmbd       99547 20  stream /var/run/samba4/nmbd/unexpected

I made sure to restart the service after making the aforementioned changes.
 
You might want to start by reading the Handbook's chapter on setting up a Samba server:

I haven't played with Samba on FreeBSD in a while, but if you try to follow the Handbook step-by-step, you should have something going successfully. And that is usually a good starting point for making changes that are applicable to your situation.
This was my first attempt followed it step by step and restarted multiple times
 
Default log directory is/var/log/samba4/ if you change the log path in smb4.conf you need to create the new path first.
You need to have that user "Beer" in your FreeBSD first then add it into samba using pdbedit -a -u Beer.
 
What is the error you eventually get? Time-out? Connection refused? Authentication error?
 
Okay guys so I think I may have found a potential cause. I installed the newer Samba version 419, which had some conflicts with my previously installed packages. Not thinking about it much (I'm quite new at this) I had it auto delete said packages. This caused some other issues as well that I didn't realize until later.

My solution for now is get a fresh FreeBSD install and try version 416 while following the handbook. I'm praying it will just work.
Thanks for al your insights and efforts!
 
My solution for now is get a fresh FreeBSD install
No need to reinstall the entire OS from scratch just because you screwed up some package installs. Look in /var/log/messages which packages got removed, and simply reinstall those. That will eventually remove the Samba 4.19 version and replace it with 4.16.

If you really want to start over you could also do pkg delete -a and uninstall all packages except pkg(8) itself. And even that could be removed with pkg delete -af.

Code:
     -a, --all  Deletes all installed packages except for pkg(8) from the
                system and cleans the database of information related to
                removed packages.
Code:
     -f, --force
                Forces packages to be removed despite leaving unresolved
                dependencies.  In combination with the -a or --all flag,
                causes pkg(8) to be removed as well as all other packages.
pkg-delete(8)

With FreeBSD the base OS is its own complete entity, third party software (ports/packages) are installed separate from the base OS (prefix /usr/local/). You don't need to reinstall the OS, this isn't Windows.
 
With FreeBSD the base OS is its own complete entity, third party software (ports/packages) are installed separate from the base OS (prefix /usr/local/). You don't need to reinstall the OS, this isn't Windows.
This is good to know. I will know what to do in the future, as I've already reinstalled..
Luckily I don't mind it much as I feel like I'm getting more proficient at the basics every time.

Thanks everybody!
 
Here's a basic skeleton smb4.conf for a single 'standalone' server:
Code:
[global]

   workgroup = WORKGROUP
   server string = Samba Server
   security = user

   log file = /var/log/samba4/log.%m
   max log size = 50

   smb ports = 445

   ;min protocol = SMB2

   multicast dns register = no

#============================ Share Definitions ==============================
[myshare]
   comment = Some shared directory
   path = /some/directory
   browseable = yes
   writable = yes
   valid users = myaccount

Then
sysrc samba_server_enable="YES"
sysrc nmbd_enable="NO"

service samba_server start
pdbedit -a -u myaccount

If you want your shares to show up under Window's "Network", install net/py-wsdd. Doesn't need any configuration, just enable and start the service.

I've disabled NMB and the old WINS and Netbios crap. Those are only useful for really old Windows clients (before windows 2000). From W2K and onward only port 445 is used.
 
So it still doesn't work...
I tried following your steps exactly. I did install py-wsdd and now the system shows up in Windows but i still cant connect. This is what my smb4.conf file looks like:

Code:
[global]

   workgroup = WORKGROUP
   server string = Samba Server
   security = user

   log file = /var/log/samba4/log.%m
   max log size = 50

   smb ports = 445

   ;min protocol = SMB2

   multicast dns register = no

#============================ Share Definitions ==============================
[myshare]
   comment = Some shared directory
   path = /nobackup
   browseable = yes
   writable = yes
   valid users = Beer

This is what my rc.conf file looks like:
Code:
clear_tmp_enable="YES"
syslogd_flags="-ss"
hostname="ketflat1.zfs.nl"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
powerd_enable="YES"
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"

#Xwindow
kld_list="i915kms"

#XFCE
dbus_enable="YES"
lightdm_enable="YES"

#Samba
samba_server_enable="YES"
nmbd_enable="NO"

#Py-wsdd
wsdd_enable="YES"
Any ideas on how to check what else could be wrong??
I feel bad for taking up so much time from everybody and all the effort is really greatly appreciated!
 
When you suspect that the error is "connection refused" (which Windows seem to imply), then the proper test procedure is:
- telnet to the TCP port in question from localhost. That will give you an actual error message if it doesn't connect
- telnet to the TCP port from a different host. That accounts for firewall and routing problems
 
Back
Top