Fixing "Failed to Start Samba.service; Unit Samba.service is Masked" Error

Introduction

Samba is a free, open-source software for Windows & Linux operating systems. It allows Windows systems to access network resources such as shared folders and files from other computers in the same network.

At times, the Samba service may fail to start with the error message “Failed to start Samba.service; Unit Samba.service is Masked”.

This article provides a step-by-step guidance on how to resolve this issue.

Steps

  1. Go to the terminal on your Linux system and execute the following command:
    sudo systemctl unmask samba.service
  2. After typing in the command, try restarting the Samba service by running the following command:
    sudo systemctl restart samba.service
  3. Check if the Samba service is up and running. Type the following command in the terminal:
    sudo systemctl status samba.service
  4. The command should output the message “Active: Active (running)”. If that is the case, the Samba service has started successfully.

FAQ

Q1  What is Samba?

Samba is a free, open-source software for Windows & Linux operating systems. It allows Windows systems to access network resources such as shared folders and files from other computers in the same network.

Q2 Why is Samba masked?

When the Samba service masking is enabled, the service will be inactive and will not start automatically after the reboot. The Samba service is masked when the system administrator manually disables the service or when security is an overriding concern.

Q3 How to unmask the Samba service?

You can unmask the Samba service by running the following command in the terminal:
sudo systemctl unmask samba.service

Q4 What does the command "sudo systemctl restart samba.service" do?

The command "sudo systemctl restart samba.service" is used to restart the Samba service. This command is required after the unmasking of the Samba service, in order to start the service.

Q5 How to check that the Samba service has successfully started?

You can check whether the Samba service has started successfully by typing in the following command in the terminal:
sudo systemctl status samba.service
If the command outputs the message “Active: Active (running)”, the Samba service has started successfully.

Conclusion

By following the steps in this article, you can now successfully start or unmask your Samba service on your Linux system to access remote-shared folders with ease.

Cannot restart samba, samba.service is masked
When I try to restart Samba, I am receiving the following error message: Failed to start samba.service: Unit samba.service is masked. In addition, when I run systemctl, it shows smbd.service in red

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Lxadm.com.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.