How to Check Samba Version on Linux Domain Controller: CLI Methods


9 views

The most straightforward way to check your Samba version is by running:

smbd --version

or alternatively:

samba --version

For more comprehensive version details including build information:

smbd -V

Sample output might look like:

Version 4.15.13-Debian
Build Date: 2023-08-17
Features: ADS, LDAP, PRINTING, ACL_SUPPORT

If you're using a package-based installation, you can query your distro's package manager:

For Debian/Ubuntu:

apt-cache policy samba

For RHEL/CentOS:

rpm -q samba

To confirm your domain controller functionality along with version:

samba-tool testparm

This will also validate your smb.conf configuration.

For scripting purposes, you can extract just the version number:

smbd --version | awk '{print $2}'

Or to get major version only:

smbd --version | awk -F. '{print $1}' | awk '{print $2}'

If you suspect version inconsistencies between nodes in your domain:

samba-tool drs showrepl --json | jq '.repsFrom[].source_dsa_invocation_id'

This requires jq installed for JSON parsing.


The simplest way to check your Samba version is to run:


smbd --version
# or alternatively
samba --version

For domain controllers, you'll want more comprehensive version details including build information:


samba -V

This returns output like: Version 4.15.5-Debian showing both the upstream version and distribution-specific patches.

To verify the version of currently running Samba services:


ps aux | grep smbd

Look for the process arguments which typically include version information.

On Debian/Ubuntu systems:


apt-cache policy samba

On RHEL/CentOS:


rpm -qi samba

For domain controllers, this command provides AD-specific version info:


samba-tool --version

When checking versions, note that:

  • Samba 4.x is required for Active Directory domain controller functionality
  • Version 4.9.0+ is recommended for current Windows domain compatibility
  • The samba-tool output is most relevant for DC functionality