防火墙 HTTP SSH

本文档展示了如何通过firewalld和iptables服务在服务器上开启HTTP和SSH访问。首先,通过安装httpd并配置index.html实现HTTP访问。然后,通过修改sshd_config文件并开放端口2000使SSH服务可用。接着,使用firewalld添加HTTP服务和2000端口,但SSH连接失败。最后,通过iptables手动配置规则,成功允许来自其他主机的HTTP和SSH访问。
摘要由CSDN通过智能技术生成

服务端开启firewalld或者iptables服务,客户端可以通过http://ip/访问到的页面信息为hello,world;客户端可以通过端口2000访问服务器的ssh服务
128:
[root@localhost ~]# yum install -y httpd
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# echo hello word >index.html
[root@localhost html]# systemctl restart httpd
测试
[root@localhost html]# curl 192.168.183.128
hello word

[root@localhost html]# vim /etc/ssh/sshd_config

在这里插入图片描述
测试:
[root@10 ~]# ssh root@192.168.183.128 -p 2000
root@192.168.183.128’s password:
Activate the web console with: systemctl enable --now cockpit.socket

This system is not registered to Red Hat Insights. See https://cloud.redhat.com/
To reg

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值