Updated: 12 October 2026 · Applies to: Samba 4.23.5 on AlmaLinux 10.2, Samba 4.23.6 on Ubuntu 26.04 and Samba 4.22.11 on Debian 13 (tested); Ubuntu 24.04 (Samba 4.19.5) unit files checked; the same commands work on Rocky Linux and RHEL 9 and 10

To restart Samba, run sudo systemctl restart smb on AlmaLinux, Rocky Linux, RHEL and Fedora, or sudo systemctl restart smbd on Ubuntu and Debian. To start it now and at every boot, use sudo systemctl enable --now smb (or smbd). On Ubuntu and Debian the name smb also works, because smb.service is an alias of smbd.service there. If the service will not start, the second half of this article shows how to find the cause.

Samba service names

  • smb (AlmaLinux, Rocky Linux, RHEL) or smbd (Ubuntu, Debian): the file and printer sharing daemon. This is the one you normally start or restart.
  • nmb or nmbd: NetBIOS name service, only needed for old-style network browsing. On Ubuntu 26.04 the default smb.conf has disable netbios = yes, so systemd skips nmbd with "Condition check resulted in nmbd.service ... being skipped". That is normal.
  • winbind: only on servers joined to an Active Directory domain.
  • samba-ad-dc: only on a server that is itself an Active Directory domain controller. On Ubuntu 26.04 and Debian 13 it comes in the separate samba-ad-dc package.

There is no service called samba on Ubuntu or Debian: systemctl restart samba answers "Unit samba.service not found."

1. Start, stop, restart and enable Samba

  1. AlmaLinux, Rocky Linux, RHEL and Fedora:
    sudo systemctl start smb
    sudo systemctl restart smb
    sudo systemctl stop smb
    sudo systemctl enable --now smb      # start now and at every boot
    The package does not enable the service after installation, so run the enable --now line once on a new server.
  2. Ubuntu and Debian:
    sudo systemctl restart smbd
    sudo systemctl restart smbd nmbd     # if you also use NetBIOS
    sudo systemctl enable --now smbd
    The package enables and starts smbd (and nmbd) when you install it.
  3. Check the result. On our AlmaLinux 10 test server (shortened):
    $ sudo systemctl status smb
    ● smb.service - Samba SMB Daemon
         Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
         Active: active (running) since Sun 2026-10-11 17:22:56 UTC; 31ms ago
       Main PID: 161 (smbd)
         Status: "smbd: ready to serve connections..."

The older service command still works and hands the job to systemctl: sudo service smbd restart on Ubuntu and Debian, and sudo service smb restart on AlmaLinux and Rocky Linux once the initscripts-service package is installed (it prints "Redirecting to /bin/systemctl restart smb.service").

2. Reload instead of restart

After a change to /etc/samba/smb.conf (a new share, changed permissions), a reload is enough:

sudo systemctl reload smb               # or smbd on Ubuntu and Debian
sudo smbcontrol all reload-config

A reload makes the running smbd read the file again, so connected users stay connected. A restart stops every smbd process, which drops open connections. According to the Samba smbd manual, smbd also reloads the file by itself every three minutes when it has changed.

3. Check that Samba answers

$ ss -ltnp | grep smbd
LISTEN 0      50         127.0.0.1:445       0.0.0.0:*    users:(("smbd",pid=171,fd=28))
LISTEN 0      50         127.0.0.1:139       0.0.0.0:*    users:(("smbd",pid=171,fd=29))
LISTEN 0      50             [::1]:445          [::]:*    users:(("smbd",pid=171,fd=30))
LISTEN 0      50             [::1]:139          [::]:*    users:(("smbd",pid=171,fd=31))

$ smbclient -L //127.0.0.1 -N
Anonymous login successful

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (Samba 4.23.5)
SMB1 disabled -- no workgroup available

Our lab server was set to listen on the loopback address only; by default smbd listens on all addresses. If the shares list locally but other computers cannot connect, open the ports as shown in Samba ports: 445, 139, 137 and 138.

4. Samba will not start: find the cause

A failed start only says "Job for smb.service failed because the control process exited with error code." Read the reason first:

sudo systemctl status smb
sudo journalctl -u smb -n 50 --no-pager
sudo tail -n 30 /var/log/samba/log.smbd
sudo testparm -s

On Ubuntu and Debian use smbd in the first two lines. Then match the message:

  • Invalid setting in smb.conf. Options from old guides stop current Samba. With security = share, testparm printed "WARNING: Ignoring invalid value 'share' for parameter 'security'" and "Error loading services.", and log.smbd showed "Can't load /etc/samba/smb.conf - run testparm to debug it". Use security = user (guest shares are described in guest and home shares) and run testparm until it ends with "Loaded services file OK.". A misspelt parameter name only gives "Unknown parameter encountered" and is ignored: Samba starts, but the setting does nothing.
  • Port 445 or 139 in use. The log shows "smbd_open_one_socket: open_socket_in failed: Address already in use". When no port at all is free, smbd logs "open_sockets_smbd: No sockets available to bind to." followed by a PANIC, and the unit fails with result 'core-dump'. Find the other program with sudo ss -ltnp 'sport = :445', usually a leftover smbd or another SMB server, and stop it.
  • "start of the service was attempted too often". On our AlmaLinux test server systemd allowed 5 starts in 10 seconds (StartLimitBurst=5, StartLimitIntervalUSec=10s), and the sixth restart was refused. Fix the cause, then run sudo systemctl reset-failed smb and start it again.
  • "Unit smb.service is masked". Someone blocked the service. Run sudo systemctl unmask smb, then start it.
  • Skipped due to 'exec-condition' (Ubuntu, Debian). Before starting, the units run /usr/share/samba/is-configured. It skips smbd and winbind when server role is "active directory domain controller" (then samba-ad-dc serves the files) and skips nmbd when NetBIOS is disabled.
  • Domain member. If the server is joined to Active Directory, check systemctl status winbind and validate the machine account with sudo net ads testjoin.

5. Samba runs, but a share does not work

  • NT_STATUS_BAD_NETWORK_NAME: the share folder does not exist. Our log.smbd showed "canonicalize_connect_path failed for service data, path /srv/samba/data". Create the folder (sudo mkdir -p), give the users access, and connect again; no restart is needed.
  • SELinux (AlmaLinux, Rocky Linux, RHEL): smbd runs, but users cannot read the folder. Label it samba_share_t as shown in how to install and configure Samba, and check denials with sudo ausearch -m avc -ts recent.
  • Users cannot log in: every user needs a separate Samba password. See how to add and change Samba users.

For smbstatus, testparm and the other tools, see Samba utilities explained.

Official documentation: smbd manual, smbcontrol manual and testparm manual.

Ucartz services for this topic

Was this answer helpful? 1 Users Found This Useful (1 Votes)