Linux

Where Is the Samba Config File on Linux?

Samba reads its main config from smb.conf, usually under /etc/samba. Runtime databases use TDB files under /var/lib/samba.

Last updated

On most distributions the main file is /etc/samba/smb.conf. Compile time defaults vary, so confirm with testparm -v or smbd -b on unusual builds.

Persistent state and account databases live under /var/lib/samba, with private secrets under /var/lib/samba/private. Validate edits with testparm before restarting file services.

Where Samba stores this, by platform

Linux
/etc/samba/smb.conf

Main config file. Contains global section plus share definitions. Use testparm to check syntax. Requires root to edit.

Linux
/var/lib/samba

State directory for TDB files. Includes idmap, locking and cache data. Private user database passdb.tdb sits in the private subfolder. Back up persistent TDB files with tdbbackup.

Frequently asked questions

How do I find the active smb.conf path?

Run testparm -v to show loaded paths, or run smbd -b and look for smb.conf plus PRIVATE_DIR and LOCKDIR. Package defaults place it in /etc/samba on Debian and RHEL based systems.

Where are Samba users stored?

With the default tdbsam backend, accounts are in /var/lib/samba/private/passdb.tdb. Manage them with smbpasswd and pdbedit. Keep permissions strict because the private folder holds secrets.

Notice an outdated path? Let us know.