centos - 在 CentOS7 上启用 Firewalld 后我无法连接

标签 centos centos7 lamp firewalld

我正在尝试使用 a guide 将 LAMP 设置为 CentOS7 .我尝试运行这些命令以允许 HTTP 和 HTTPS 流量:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
但是系统给出了这个错误:
FirewallD is not running
所以我searched然后应用这些命令:
systemctl enable firewalld
systemctl start firewalld
然后它打印“已完成”输出,但我的连接被中止,我无法使用 IP:Port 和 PuTTy 连接到服务器了。
我应该怎么办?对我来说,唯一可以访问服务器的方式就是这种方式。我没有对服务器的物理访问权限。

最佳答案

看起来你把自己锁在外面了,因为你没有指定 ssh也应该允许:

sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --reload
上面的指南似乎假设 ssh已经被允许。

What should I do? The only access to the server was that way for me. I have no physical access to the server.


因此,此时访问服务器的唯一方法通常是通过托管服务提供商/虚拟化解决方案的 VM 控制台。几乎所有提供商都允许您访问该控制台,因此您应该尝试这样做。通过控制台登录后,您可以运行上述命令以允许 SSH 通过 SSH 重新获得访问权限。

关于centos - 在 CentOS7 上启用 Firewalld 后我无法连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64983526/

相关文章:

php - SilverStripe:禁止的权限错误

python - Centos Python Dockerfile 图像大小减少

ldap_modify : Other (e. g.,具体实现)错误 (80)

linux - Ubuntu Server VMware www 文件夹不工作

centos - 无法在 CENTOS 上的节点中运行 meteor 包

sockets - ai_socktype 不支持 Servname

git - git 通过 https 推送到远程服务器时出错 fatal error 无法切换到 :permission denied

node.js - Dockerize meteor 应用程序

c# - 将 C# 编译为 CGI

php - 我的目录中不存在 mcrypt.ini