Samba : setting up and tweaking

[groups] share requires you to make the directory /home/groups?

Were you asking me about this ?

I’m not sure what groups needs, but i’m entering same ID/password as with profiles and it does not allow groups share.

I was trying to point out that the [groups] share won’t work until you create the directory /home/groups and chmod that directory to 777 (or make some other arrangement with permissions to make it accessible). You can see the properties if you run “act /etc/samba/smb.conf”. It’s best to delete the setup from smb.conf IMO.

On Sun August 30 2009 12:56 pm, manchette fr wrote:

>
> hi :wink:
>
> i added another seven , the network is now :
> opensuse111, seven, seven2.
>
> i n fact i removed all the 3.4 samba rpms and went back to the previous
> version (3.2.7).
>
> here’s what i have now :
>
> - seven can access linux easily, what i created, and default share
> profiles ; strangely groups share does not work
>
> - opensuse can’t access seven , despite using windows seven admin IDs
> . i don’t get why . I haven’t tried without the firewall, i might try
> this 1st, and if it does not help it might then be a samba/seven issue
> (?)
>
> - seven2 can’t access seven , despite using windows seven admin IDs
>
> - seven can’t access seven2 but i still need to figure out the name and
> paswword of the root in seven2, plus the firewall possible issue.
>
>
manchette fr;

If one Windows7 machine cannot access the other, then this is almost certainly
a firewall problem on Windows7(or perhaps some other configuration problem).
You will need to open the file/print sharing ports. (These are the same as
the Samba ports previously posted).

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Hi :wink:

i understand that the Groups share needs to be tweaked a bit more if needed. What’s he difference between groups share and my_share i created ? Security ?
It’s gonna be at home, so i don’t need strong security features.

Strangely after installing differently windows (some preconfigured softwares and options removed) it now sees pcs on the network , without opening the ports, that’s a surprise for me.

I need more time to figure out if all pcs can access each other.

I also have a printer issue but i’ll tell you about this part after we have fixed network accesses :wink:

Hello!
I have the similar trouble with samba after update opensuse 11.1 to 11.2.
The samba was worked properly at 11.1 as local master browser. I have used old smb.conf after distrib update and obtained the problem: after system boot both samba demons are running but nmbd is not work properly.
My computer is not present in network neightbourhood of other machines and other server is became a local master.
But I can login to remote shares using IP address -> smbd is work good.
I try
/etc/init.d/nmb status - obtain - “running”
try
/etc/init.d/nmb restart - obtain daemon is shutting down with some second timeout and then daemon is started. However samba name service does not work. After
/etc/init.d/nmb stop (with answer that daemon shutdown sucssesfully) I can see the alive nmbd process in the list of processes.
After “killall nmbd” the daemon start and work properly - with full list of network neightbourhood.

Why it wrongly start at system boot?

P.S. I add to smb.conf “passdb backend = tdbsam” and convert user database to new standart after some exercises but no changes obtain…

On Thu December 3 2009 02:16 pm, rommel38 wrote:

>
> Hello!
> I have the similar trouble with samba after update opensuse 11.1 to
> 11.2.
> The samba was worked properly at 11.1 as local master browser. I have
> used old smb.conf after distrib update and obtained the problem: after
> system boot both samba demons are running but nmbd is not work
> properly.
> My computer is not present in network neightbourhood of other machines
> and other server is became a local master.
> But I can login to remote shares using IP address → smbd is work
> good.
> I try
> /etc/init.d/nmb status - obtain - “running”
> try
> /etc/init.d/nmb restart - obtain daemon is shutting down with some
> second timeout and then daemon is started. However samba name service
> does not work. After
> /etc/init.d/nmb stop (with answer that daemon shutdown sucssesfully) I
> can see the alive nmbd process in the list of processes.
> After “killall nmbd” the daemon start and work properly - with full
> list of network neightbourhood.
>
> Why it wrongly start at system boot?
>
> P.S. I add to smb.conf “passdb backend = tdbsam” and convert user
> database to new standart after some exercises but no changes obtain…
>
>
rommel38;

  1. Check YaST–>System–>System Services and make sure nmb is enabled for run
    levels 3 and 5.
  2. Verify that the firewall allows Broadcasts and that the following ports are
    open:
    TCP: 135,139 & 445
    UDP: 137 & 138
  3. Check /var/log/samba/log.nmbd to see if there are any errors logged.
  4. Check your Apparmor settings.
    If the above do not help, please post the contents of your /etc/samba/smb.conf
    and any errors found in the nmbd log.


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

@venzkep
It’s difficult to check these in 11.2 even though you are quite correct about the ports:

  1. Verify that the firewall allows Broadcasts and that the following ports are
    open:
    TCP: 135,139 & 445
    UDP: 137 & 138

In 11.2 you can goto Yast’s firewall module → allowed services and add these: netbio-server, samba-server, samba-client and that will achieve it (for 11.2 only, once again the GUI is different from the past GUIs).

FYI:
samba-server → TCP: netbios-ssn microsoft-ds
samba-client → kernel conntrack module for network 0/0 (all) for UDP:137 *
netbios-server → UDP: netbios-ns netbios-dgm plus BROADCASTS (for netbios-ns netbios-dgm)
So that’s the new way to cover all bases, although on reflection I wonder where 445 is in that, hmm, needs looking at, maybe?*

On Thu December 3 2009 03:06 pm, swerdna wrote:

>
> @venzkep
> It’s difficult to check these in 11.2 even though you are quite correct
> about the ports:
>> 2. Verify that the firewall allows Broadcasts and that the following
>> ports are
>> open:
>> TCP: 135,139 & 445
>> UDP: 137 & 138
> In 11.2 you can goto Yast’s firewall module → allowed services and
> add these: netbio-server, samba-server, samba-client and that will
> achieve it (for 11.2 only, once again the GUI is different from the past
> GUIs).
>
> FYI:
> samba-server → TCP: netbios-ssn microsoft-ds
> samba-client → kernel conntrack module for network 0/0 (all) for
> UDP:137 *
> netbios-server → UDP: netbios-ns netbios-dgm plus BROADCASTS (for
> netbios-ns netbios-dgm)
> So that’s the new way to cover all bases, although on reflection I
> wonder where 445 is in that, hmm, needs looking at, maybe?
>
>*
Swerdna;

Thanks for the tip. One could, of course, use “iptables -L -n” to see what is
open.
Port 445 should be:


microsoft-ds

See the contents of /etc/services

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Hello! Thanks for answers!

smb.conf :

[global]
workgroup = WORKGROUP
netbios name = gor
server string = Samba on SuSe
printcap name = cups
cups options = raw
map to guest = Bad User
logon path = \\%25L\profiles\.msprofile
logon home = \\%25L\%25U\.9xprofile
logon drive = P:
hostname lookups = yes
write list = rommel
security = domain
domain master = no
os level = 255
preferred master = yes
name resolve order = bcast lmhosts
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
dont descend = /proc, ./proc, /dev
message command = /usr/bin/winpopup-send %s %m %t &
domain logons = no
wins support = Yes
add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
passdb backend = smbpasswd
restrict anonymous = no
[shares]
comment = LAN shares
path = /home/rommel/public
inherit acls = Yes
guest ok = yes

log.nmbd (normal work to moment 2:36 and failed name service after) :


[2009/11/23 02:33:54,  0] nmbd/nmbd_become_lmb.c:395(become_local_master_stage2)
  *****
  
  Samba name server GOR is now a local master browser for workgroup WORKGROUP on subnet 192.168.0.69
  
  *****
[2009/11/23 02:33:54,  0] nmbd/nmbd_browsesync.c:350(find_domain_master_name_query_fail)
  find_domain_master_name_query_fail:
  Unable to find the Domain Master Browser name WORKGROUP<1b> for the workgroup WORKGROUP.
  Unable to sync browse lists in this workgroup.
[2009/11/23 02:36:23,  0] nmbd/nmbd.c:71(terminate)
  Got SIGTERM: going down...
[2009/11/23 02:36:23,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
[2009/11/23 02:36:23,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
[2009/11/23 02:36:23,  0] nmbd/nmbd_namerelease.c:165(wins_release_name)
  release_name: Failed to send packet trying to release name WORKGROUP<1e> IP 192.168.0.69
[2009/11/23 02:36:23,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
[2009/11/23 02:36:23,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
[2009/11/23 02:36:23,  0] nmbd/nmbd_namerelease.c:165(wins_release_name)
  release_name: Failed to send packet trying to release name WORKGROUP<00> IP 192.168.0.69
[2009/11/23 02:36:23,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
[2009/11/23 02:36:23,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
[2009/11/23 02:36:23,  0] nmbd/nmbd_namerelease.c:165(wins_release_name)
  release_name: Failed to send packet trying to release name GOR<00> IP 192.168.0.69
[2009/11/23 02:36:23,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
[2009/11/23 02:36:24,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
[2009/11/23 02:36:24,  0] nmbd/nmbd_namerelease.c:165(wins_release_name)
  release_name: Failed to send packet trying to release name GOR<03> IP 192.168.0.69
[2009/11/23 02:36:24,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
[2009/11/23 02:36:24,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
[2009/11/23 02:36:24,  0] nmbd/nmbd_namerelease.c:165(wins_release_name)
  release_name: Failed to send packet trying to release name GOR<20> IP 192.168.0.69
[2009/11/23 02:36:24,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 192.168.0.255(138) ERRNO=Invalid argument
[2009/11/23 02:36:24,  0] libsmb/nmblib.c:834(send_udp)
  Packet send failed to 192.168.0.255(138) ERRNO=Invalid argument
[2009/11/23 07:48:18,  0] nmbd/nmbd.c:854(main)
  nmbd version 3.4.2-1.1.3.1-2229-SUSE-SL11.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009
[2009/11/23 07:48:18,  0] nmbd/asyncdns.c:155(start_async_dns)
  started asyncdns process 1498
[2009/11/23 09:36:23,  0] nmbd/nmbd.c:854(main)
  nmbd version 3.4.2-1.1.3.1-2229-SUSE-SL11.2 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009
[2009/11/23 09:36:23,  0] nmbd/asyncdns.c:155(start_async_dns)
  started asyncdns process 1478

Samba service of course start in 3 and 5 runlevels (it is evident from yast-runlevels and i see that the nmbd and smbd processes always present in “ps -e” output)

Firewall does not any barriers for samba! When I manually restart nmbd (kill nmb process and do /etc/init.d/nmb start) all related samba work fine. Firewall configs are unchanged from suse 11.1.
(the 137-139 443 ports are opened,services are allowed, broadcast is allowed)

apparmor is unused.

I have broken work of the name daemon when it started from system boot scripts :’(
Manual start is good start :\

I can’t understand the reason of such behavior of samba…

How I can downgrade the samba to version from suse 11.1?
Can work old samba version with new kernel?

On Thu December 3 2009 05:36 pm, rommel38 wrote:

>
> Hello! Thanks for answers!
>
> smb.conf :
>
> Code:
> --------------------
> [global]
> workgroup = WORKGROUP
> netbios name = gor
> server string = Samba on SuSe
> printcap name = cups
> cups options = raw
> map to guest = Bad User
> logon path = \%25L\profiles.msprofile
> logon home = \%25L%25U.9xprofile
> logon drive = P:
> hostname lookups = yes
> write list = rommel
The above is a share level parameter. It would be best to move it into your
shares
> security = domain
The above parameter should be set if and only if this is a member server of an
NT4 Domain. Otherwise just use the default value (i.e. security = user)
> domain master = no
> os level = 255
> preferred master = yes
> name resolve order = bcast lmhosts
> socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
Modern kernels do a better job of setting these, about the only thing that may
be currently useful is “TCP_Nodelay”
> dont descend = /proc, ./proc, /dev
This is again a Share level parameter and belongs in your shares
> message command = /usr/bin/winpopup-send %s %m %t &
> domain logons = no
> wins support = Yes
> add machine script = /usr/sbin/useradd -c
Machine -d /var/lib/nobody -s /bin/false %m$
> passdb backend = smbpasswd
You are still using smbpasswd not tdbsam as in your first post.
> restrict anonymous = no
The permissable values of restrict anonymous are 0,1 & 2
> [shares]
> comment = LAN shares
> path = /home/rommel/public
> inherit acls = Yes
> guest ok = yes
>
> --------------------
>
>
> log.nmbd (normal work to moment 2:36 and failed name service after) :
> Code:
> --------------------
>
> [2009/11/23 02:33:54, 0] nmbd/nmbd_become_lmb.c:39
(become_local_master_stage2)
> *****
>
> Samba name server GOR is now a local master browser for workgroup
WORKGROUP on subnet 192.168.0.69
>
> *****
> [2009/11/23 02:33:54, 0] nmbd/nmbd_browsesync.c:35
(find_domain_master_name_query_fail)
> find_domain_master_name_query_fail:
> Unable to find the Domain Master Browser name WORKGROUP<1b> for the
workgroup WORKGROUP.
> Unable to sync browse lists in this workgroup.
> [2009/11/23 02:36:23, 0] nmbd/nmbd.c:71(terminate)
> Got SIGTERM: going down…
> [2009/11/23 02:36:23, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
> [2009/11/23 02:36:23, 0] nmbd/nmbd_packets.c:158(send_netbios_packet)
> send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
> [2009/11/23 02:36:23, 0] nmbd/nmbd_namerelease.c:165(wins_release_name)
> release_name: Failed to send packet trying to release name WORKGROUP<1e>
IP 192.168.0.69
> [2009/11/23 02:36:23, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
> [2009/11/23 02:36:23, 0] nmbd/nmbd_packets.c:158(send_netbios_packet)
> send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
> [2009/11/23 02:36:23, 0] nmbd/nmbd_namerelease.c:165(wins_release_name)
> release_name: Failed to send packet trying to release name WORKGROUP<00>
IP 192.168.0.69
> [2009/11/23 02:36:23, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
> [2009/11/23 02:36:23, 0] nmbd/nmbd_packets.c:158(send_netbios_packet)
> send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
> [2009/11/23 02:36:23, 0] nmbd/nmbd_namerelease.c:165(wins_release_name)
> release_name: Failed to send packet trying to release name GOR<00> IP
192.168.0.69
> [2009/11/23 02:36:23, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
> [2009/11/23 02:36:24, 0] nmbd/nmbd_packets.c:158(send_netbios_packet)
> send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
> [2009/11/23 02:36:24, 0] nmbd/nmbd_namerelease.c:165(wins_release_name)
> release_name: Failed to send packet trying to release name GOR<03> IP
192.168.0.69
> [2009/11/23 02:36:24, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 127.0.0.1(137) ERRNO=Invalid argument
> [2009/11/23 02:36:24, 0] nmbd/nmbd_packets.c:158(send_netbios_packet)
> send_netbios_packet: send_packet() to IP 127.0.0.1 port 137 failed
> [2009/11/23 02:36:24, 0] nmbd/nmbd_namerelease.c:165(wins_release_name)
> release_name: Failed to send packet trying to release name GOR<20> IP
192.168.0.69
> [2009/11/23 02:36:24, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 192.168.0.255(138) ERRNO=Invalid argument
> [2009/11/23 02:36:24, 0] libsmb/nmblib.c:834(send_udp)
> Packet send failed to 192.168.0.255(138) ERRNO=Invalid argument
> [2009/11/23 07:48:18, 0] nmbd/nmbd.c:854(main)
> nmbd version 3.4.2-1.1.3.1-2229-SUSE-SL11.2 started.
> Copyright Andrew Tridgell and the Samba Team 1992-2009
> [2009/11/23 07:48:18, 0] nmbd/asyncdns.c:155(start_async_dns)
> started asyncdns process 1498
> [2009/11/23 09:36:23, 0] nmbd/nmbd.c:854(main)
> nmbd version 3.4.2-1.1.3.1-2229-SUSE-SL11.2 started.
> Copyright Andrew Tridgell and the Samba Team 1992-2009
> [2009/11/23 09:36:23, 0] nmbd/asyncdns.c:155(start_async_dns)
> started asyncdns process 1478
> --------------------
>
>
> Samba service of course start in 3 and 5 runlevels (it is evident from
> yast-runlevels and i see that the nmbd and smbd processes always present
> in “ps -e” output)
>
> Firewall does not any barriers for samba! When I manually restart nmbd
> (kill nmb process and do /etc/init.d/nmb start) all related samba work
> fine. Firewall configs are unchanged from suse 11.1.
> (the 137-139 443 ports are opened,services are allowed, broadcast is
> allowed)
That should be 445 not 443, I assume its just a typo.
> apparmor is unused.
>
> I have broken work of the name daemon when it started from system boot
> scripts :’(
> Manual start is good start :
>
> I can’t understand the reason of such behavior of samba…
>
> How I can downgrade the samba to version from suse 11.1?
> Can work old samba version with new kernel?
>
rommel38;

Is this a member server of an NT4 domain? If yes is it joined to the domain?
If not see the above notes on your smb.conf and change your security
parameter. If you are not familiar with Swerdna’s HowTos it might help to
review:
http://opensuse.swerdna.org/suselanprimer.html
and
http://opensuse.swerdna.org/susesambaserver.html

Post back if this does not help.


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Hello!
My network is without domains - workgroup only.

Follow your recommendation:
I remove “security = domain” thanks!
I correct to “socket options = TCP_NODELAY”

I’m change back the “passdb backend = smbpasswd” in my experiments with samba but I haven’t any improvements with value “tdbsam” too.

O sorry, of course 445 port… I was almost sleeping when write this.

The situation is not change after these correction of smb.conf:
the nmbd doesn’t work after system boot (but it is present in processes list).
All work best after “killall nmbd” and “/etc/init.d/nmb start”

P.S. Thanks for links!

Your workgroup name is absent; that defines the worgroup name to the default, viz: WORKGROUP. Is that what you want?

There are some inconsistencies in your smb.conf. I suggest that you make a backup copy of smb.conf and then replace the original with this one:

[global]
workgroup = WORKGROUP
netbios name = gor
name resolve order = bcast host lmhosts wins
server string = Samba on SuSe
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 65

[shares]
comment = LAN shares
path = /home/rommel/public
inherit acls = Yes
guest ok = yes

Note to check that WORKGROUP is the name that you have on the other machines

Check in Yast → system → runlevels that you have nmb and smb switched on – leave the specific runlevel selections as the defaults; viz: 3 and 5

Restart Samba with these commands:

  • sudo /etc/init.d/nmb restart
  • sudo /etc/init.d/smb restart

Check who is in the password dbase with this command:

  • sudo pdbedit -L

and adjust it appropriately with these commands: sudo smbpasswd -x to delete, -a to add, -a to change (see man smbpasswd).

Check in Yast → security and users → firewall. Check (1) that all the network interfaces are set to the external zone and (2) that the allowed services include netbios-server, samba-server and samba-client.

Turn all modems, routers and network switches off, pause, and on again.

Reboot all the computers in the LAN , one after the other, waiting until each has completely rebooted before rebooting the next one, and do the circuit twice.

Wait 10 minutes. Then try the network browsers again.

Tip: this is a handy diagnostic command:
*]smbtree -N

Thanks for your attention and help!

After some day I see that venzkep’s recommendations are right!
I move some strings of smb.conf to [shares] from [global] and delete strings related to domain security options and socket options.

Old version of samba (from suse 11.1) was working normally with old my config :open_mouth:
This new is evedently required more correct config.

P.S. “pdbedit” is new for me, thanks again!

rommel38 wrote:

>
> Thanks for your attention and help!
>
> After some day I see that venzkep’s recommendations are right!
> I move some strings of smb.conf to [shares] from [global] and delete
> strings related to domain security options and socket options.
>
> Old version of samba (from suse 11.1) was working normally with old my
> config :open_mouth:
> This new is evedently required more correct config.
>
> P.S. “pdbedit” is new for me, thanks again!
>
>
rommel38;
Glad to see you have it going. Feel free to post again if you have
questions. Enjoy your file/print sharing.

P.V.
“We’re all in this together, I’m pulling for you.” Red Green

Hello!

I have a new question.
There is smbstatus tool present. This tool has not been working properly after I upgrade suse 11.1 to 11.2 :slight_smile: as I wrote earlier.

Before:
If enter smbstatus as user then it present me usual status message, like this:


Samba version 3.4.2-1.1.3.1-2229-SUSE-SL11.2
PID     Username      Group         Machine
-------------------------------------------------------------------

Service      pid     machine       Connected at
-------------------------------------------------------

No locked files

Now:
From user account I obtain this:


rommel@gor:~> smbstatus
ERROR: Failed to initialise messages database: Отказано в доступе
messaging_tdb_init failed: NT_STATUS_ACCESS_DENIED
messaging_init failed

It answer me status message now only if I enter smbstatus command as root.

What is wrong?

Solution for me, See the link as below.
Samba Clear WINS cache (wins.dat)