LinuxCommandLibrary

samba

SMB/CIFS file sharing and Active Directory server

TLDR

Start the Samba AD DC daemon in the foreground

$ samba -i
copy
Start with a specific configuration file
$ samba -s [/etc/samba/smb.conf]
copy
Start with debug logging
$ samba -d [3]
copy
Check Samba version
$ samba --version
copy
Start as a classic NT4-style domain controller
$ samba --option="server role=classic primary domain controller"
copy

SYNOPSIS

samba [-D] [-i] [-M model] [--no-process-group] [-d debuglevel] [-s configfile]

DESCRIPTION

Samba is a software suite that implements the SMB/CIFS protocol, allowing Unix systems to share files and printers with Windows clients. The samba daemon provides Active Directory Domain Controller services.
The suite consists of several components: smbd handles file and print services, nmbd provides NetBIOS name resolution and browsing, winbindd handles user and group lookups, and samba itself acts as an AD domain controller when configured.
Configuration is managed through /etc/samba/smb.conf, which defines shares, authentication, and network settings. Samba can integrate with existing Windows domains or serve as a complete replacement for Windows Server AD infrastructure.

PARAMETERS

-D, --daemon

Run as a daemon (background process)
-i, --interactive
Run interactively in the foreground
-M model, --model=model
Select process model: single, standard, prefork, thread
-d level, --debuglevel=level
Set debug logging level (0-10)
-s file, --configfile=file
Use alternate configuration file
--no-process-group
Don't create a new process group
-V, --version
Print version information

CONFIGURATION

/etc/samba/smb.conf

Main Samba configuration file defining shares, authentication methods, network settings, and domain controller parameters.
/var/lib/samba/
Samba state directory containing databases for user accounts, group mappings, and domain data.

CAVEATS

Running Samba as an AD DC requires careful DNS and Kerberos configuration. The samba daemon (AD DC mode) and smbd/nmbd (file server mode) are mutually exclusive configurations. Firewall rules must allow ports 139, 445 for SMB, and 88, 389, 636 for AD services.

HISTORY

Samba was created by Andrew Tridgell in 1992 as a reverse-engineered implementation of SMB. Originally named "smbserver," it was renamed Samba after trademark concerns. Active Directory support was added in version 4.0 (2012), enabling full domain controller functionality.

SEE ALSO

smbd(8), nmbd(8), smbclient(1), testparm(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community