Cannot restart samba, samba.service is masked

Solution 1:

Debian and debian-derivatives changed the service name from 'samba' to 'smbd'.

Try service smbd restart.

Solution 2:

Try:

sudo systemctl unmask samba
sudo systemctl enable samba
sudo systemctl restart samba