23.4 Configuring the Ubuntu Firewall to Enable Samba
Next, the firewall currently protecting the Ubuntu system needs to be configured to allow Samba traffic.
If you are using the Uncomplicated Firewall (ufw) run the following command:
# ufw allow samba
Alternatively, if you are using firewalld, run the firewall-cmd command as follows:
# firewall-cmd --permanent --add-port={139/tcp,445/tcp}
# firewall-cmd --reload
Before starting the Samba service a number of configuration steps are necessary to define how the Ubuntu system will appear to Windows systems, and the resources which are to be shared with remote clients. The majority of these configuration tasks take place within the /etc/samba/smb.conf file.