Command 'firewall-cmd' not found, but can be installed with: sudo apt install firewalld
时间: 2024-01-20 19:14:35 浏览: 265
根据提供的引用内容,看起来你正在使用Ubuntu操作系统,而firewall-cmd是CentOS/RHEL操作系统上的防火墙管理工具。因此,你需要安装firewalld来代替firewall-cmd。你可以使用以下命令来安装firewalld:
```
sudo apt install firewalld
```
安装完成后,你可以使用以下命令来添加端口并重新加载防火墙:
```
sudo firewall-cmd --zone=public --add-port=6789/tcp --permanent
sudo firewall-cmd --reload
```
相关问题
Unit firewalld.service could not be found.
This error message means that the firewalld service is not installed on your system or it is not running. Firewalld is a firewall management tool for Linux-based systems. You can check whether firewalld is installed on your system by running the following command:
```
sudo systemctl status firewalld
```
If the output shows that the service is not found, you can install it using the package manager for your Linux distribution. For example, on a Red Hat-based system, you can install firewalld using the following command:
```
sudo yum install firewalld
```
After installing firewalld, you can start and enable it using the following commands:
```
sudo systemctl start firewalld
sudo systemctl enable firewalld
```
This will ensure that firewalld is running and will start automatically on system boot.
Failed to issue method call: Unit firewalld.service not loaded.
As an AI language model, I don't have the complete context of your issue. However, it seems like the firewall service is not loaded on your system. Here are the steps you can follow to resolve this issue:
1. Check if the firewalld package is installed on your system using the following command:
```
rpm -qa | grep firewalld
```
If the package is not installed, install it using the following command:
```
sudo yum install firewalld
```
2. Once the package is installed, start the firewalld service using the following command:
```
sudo systemctl start firewalld
```
3. Enable the firewalld service to start automatically on system boot using the following command:
```
sudo systemctl enable firewalld
```
4. Verify the status of the firewalld service using the following command:
```
sudo systemctl status firewalld
```
If the service is running, you should see the status as "active (running)". If not, try restarting the service using the following command:
```
sudo systemctl restart firewalld
```
Once the firewalld service is running, you should be able to issue method calls without any errors.
阅读全文