Linux

Where Is the Samba Config File?

Where Samba keeps smb.conf and its databases on Linux file servers, and how to validate edits.

Last updated

Samba configuration centers on /etc/samba/smb.conf: global behavior plus one section per share. Helpers like testparm read that exact file, so there is no ambiguity about which config is live.

Runtime databases sit apart under /var/lib/samba. A file-server migration needs both trees: shares from etc and trust data from var. Match Samba versions first; database formats shift between major releases.

Where Samba stores this, by platform

Linux
/etc/samba/smb.conf

Main config smb.conf plus lmhosts. Validate with testparm before reloading. Runtime DBs under /var/lib/samba/ travel separately on migrations.

Frequently asked questions

How do I apply smb.conf changes?

Run testparm to validate, then systemctl reload smbd nmbd (or the combined smb service). testparm prints the effective config and catches typos before they break shares. Keep a dated copy of smb.conf before big edits.

What else to back up besides smb.conf?

Account and locking databases live under /var/lib/samba (passdb.tdb, locking dirs). Back those up with smb.conf to preserve machine trust state. Config in /etc/samba alone restores shares but not domain membership.

Notice an outdated path? Let us know.