When implementing Samba as a Primary Domain Controller (PDC) with roaming profiles, administrators often face a critical challenge: enforcing SMB encryption without disrupting domain trust relationships. The specific error "The trust relationship between this workstation and the primary domain could not be established"
typically occurs when Windows 8/8.1 clients attempt to authenticate after enabling strict encryption requirements.
The conflict arises from Windows 8.x clients' behavior during domain join operations. These versions attempt to establish secure channel communications using older protocols when encryption is mandated globally. The machine account password exchange fails because the client tries to use weaker encryption methods than what the server demands.
# Problematic configuration in smb.conf
[global]
server signing = mandatory
smb encrypt = mandatory
Instead of applying encryption globally, we can implement a more surgical approach that:
- Maintains compatibility during domain join
- Secures sensitive data transfers
- Preserves the trust relationship
Here's the modified smb.conf that solves the issue:
[global]
# ... other global settings ...
# Relaxed encryption for domain operations
server signing = auto
smb encrypt = auto
# Special handling for Windows 8/8.1 clients
client min protocol = SMB2
client max protocol = SMB3
[profiles]
# Force encryption for sensitive data
path = /var/lib/samba/profiles
server signing = mandatory
smb encrypt = mandatory
# ... other share settings ...
To confirm encryption is working for profile transfers:
# Check active SMB connections
sudo smbstatus
# Monitor network traffic
sudo tcpdump -i eth0 -n port 445 -A | grep -i "SMB2"
For environments requiring strict security:
- Implement IPsec for all domain controllers
- Use GPO to enforce SMB encryption on Windows clients
- Consider upgrading to Samba 4.9+ for better SMB3 support
If issues persist:
- Check
/var/log/samba/log.*
with increased debug level - Verify time synchronization between DC and clients
- Test with
smbclient
to isolate authentication issues
When implementing Samba as a Primary Domain Controller (PDC) with roaming profiles, enforcing SMB encryption presents unique challenges. The configuration you've attempted with server signing = mandatory
and smb encrypt = mandatory
in the global section is technically correct, but Windows 8/8.1 clients exhibit trust relationship failures due to protocol version mismatches.
Samba on Ubuntu 14.04 primarily supports SMB1 and limited SMB2 features, while Windows 8+ clients default to SMB3. The trust relationship error occurs during the initial secure channel establishment before encryption negotiation begins. Here's what happens at each stage:
1. Client attempts secure channel establishment (SMB1)
2. Server demands encryption (SMB3)
3. Protocol version mismatch causes authentication failure
4. Trust relationship appears broken
This modified smb.conf
provides a gradual encryption implementation that maintains compatibility:
[global]
# Original configuration remains unchanged
server min protocol = SMB2_02
client min protocol = SMB2_02
server max protocol = SMB3
client max protocol = SMB3
# Modified encryption settings
server signing = auto
smb encrypt = desired
# Kerberos requirements
kerberos method = secrets and keytab
dedicated keytab file = /etc/krb5.keytab
Windows clients need these registry adjustments (create a .reg file):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
"RequireSecureNegotiate"=dword:00000000
"EnablePlainTextPassword"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ldap]
"LDAPClientIntegrity"=dword:00000001
After implementation, verify encryption status with:
# On Linux:
smbstatus -v
# On Windows:
Get-SmbConnection | Select-Object ServerName,ShareName,Encrypted
For packet-level verification, use Wireshark with these display filters:
smb2.cmd == 3 || smb2.cmd == 11 # Session setup and tree connect
frame contains "SMB2" and not smb2.encrypted
For environments requiring strict encryption:
- Implement IPsec between domain members and DCs
- Upgrade to Samba 4.12+ with full SMB3 support
- Consider using FreeIPA with Samba for better Kerberos integration