Access denied trying to enable or unmask firewalld

68,063

Solution 1

solution

sudo systemctl unmask --now firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld

Solution 2

Here's what worked for me.

Check for hanging firewalld proceses, e.g:

root  16278  1  4 Jan 13 ?  00:00:00 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

kill them and then:

# yum reinstall firewalld
# service unmask firewalld
# service enable firewalld
# service start firewalld

And of course, look in journalctl to see what happened earlier.

Solution 3

This is highly recommended that you have a firewall protecting your server:

This error comes when you are trying to start or enable service which is either not installed on your Linux system or you typed an incorrect service name. See list of Services by typing:

systemctl list-units --type=service

Install if not available:

yum install firewalld

You can enable firewalld by typing:

systemctl enable firewalld
sudo systemctl enable firewalld

You can start firewalld by typing:

systemctl start firewalld
sudo systemctl start firewalld

Have a look to check its status by typing:

systemctl status firewalld
Share:
68,063

Related videos on Youtube

MahuLovzYou
Author by

MahuLovzYou

Updated on September 18, 2022

Comments

  • MahuLovzYou
    MahuLovzYou almost 2 years

    My firewall is currently inactive.

    systemctl status firewalld firewalld.service Loaded: masked (/dev/null) Active: inactive (dead)
    

    I used the following command to enable the firewall

    # systemctl unmask firewalld 
    

    but I got this error:

    # systemctl unmask firewalld 
    Failed to issue method call: Access denied
    
    # sudo systemctl restart firewalld
    Failed to issue method call: Unit firewalld.service failed to load: No such file or directory. 
    
    # sudo systemctl enable firewalld 
    Failed to issue method call: Access denied 
    
  • Pierre.Vriens
    Pierre.Vriens about 8 years
    What does that link include?
  • Peter
    Peter about 8 years
    The exact instructions on how to install and and enable iptables for RHEL 7/centos 7 .
  • Michael Hampton
    Michael Hampton almost 4 years
    This is correct. The OP does not have firewalld installed, and needs to install it.