Cracklib

cracklib
First of all add USE=cracklib end rebuild world:

Install some tools:

Now we can create DB:

Use pdbedit
pdbedit is a tool that can be used only by root. It is used to manage the passdb backend, as well as domain-wide account policy settings. pdbedit can be used to: Commands will be executed to establish controls for our domain as follows: The following command execution will achieve these settings:
 * add, remove, or modify user accounts.
 * list user accounts.
 * migrate user accounts.
 * migrate group accounts.
 * manage account policies.
 * manage domain access policy settings.
 * 1) min password length = 8 characters.
 * 2) password history = last 4 passwords.
 * 3) maximum password age = 90 days.
 * 4) minimum password age = 7 days.
 * 5) bad lockout attempt = 8 bad logon attempts.
 * 6) lockout duration = forever, account must be manually reenabled.

crackcheck
Next we may use crackcheck to check complicity of passwords:

Unpack samba-*.tar.gz and cd to. Then compile it:

Copy this to somewhere more sensible:

Edit your samba configuration:

Reload samba configuration: