• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : How to open the Firewall port for Samba server using FirewallD

By admin

Question : I cannot reach my Samba server after starting the service. How do I open the port to be able to connect to my Samba server?

Solution :

If running FirewallD, it is mandatory to open the ports used by the Samba server in order for it to properly accept clients. To begin with check the firewalld status using the systemctl command :

# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2016-10-29 21:47:04 IST; 1 weeks 4 days ago
 Main PID: 1055 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1055 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Oct 29 21:46:50 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 29 21:47:04 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

As seen in the output above the firewall service is active and running. So we are good to go further.

Check the list of open ports and services using the commands below :

# firewall-cmd --list-ports
# firewall-cmd --list-services

Once you have confirmed that the samba ports are not open on the system, open the Samba port using the following FirewallD command:

# firewall-cmd --add-service=samba

The above command will change the runtime, opening the port temporarily. Make the changes permanent using the following command (this will persist through reboot):

# firewall-cmd --add-service=samba --permanent

Verify

To verify if the samba service is added to the firewalld use :

# firewall-cmd --list-services
dhcpv6-client samba ssh

As you can see samba service is now added to the firewall and samba ports are now open.

Filed Under: CentOS/RHEL 7

Some more articles you might also be interested in …

  1. ‘lxc_cgfs – Device or resource busy – failed to set memory.use_hierarchy to 1; continuing’ – error while starting LXC container
  2. How to Setup a squid proxy server on CentOS/RHEL 7
  3. CentOS / RHEL 7 : How to disable all tty consoles and enable only 1
  4. How to Enable Thin LVM Automatic Extension
  5. RHEL 7 – RHCSA Notes (Cheat Sheets)
  6. CentOS / RHEL 7 : How to configure kdump using GUI
  7. Understanding DNS zone files
  8. CentOS / RHEL 7 : How to enable telnet for a group of users
  9. CentOS / RHEL 7 : How to configure Network Bonding or NIC teaming
  10. How to Configure Network Teaming in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary