linux暴露端口可以被外部訪問



linux暴露端口可以被外部訪問,把端口號換成要暴露的端口:
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

Centos 7 開啟端口
CentOS 7 默認沒有使用iptables,所以通過編輯iptables的配置文件來開啟80端口是不可以的,CentOS 7 采用了 firewalld 防火牆
查詢是否開啟80端口則:firewall-cmd --query-port=80/tcp
開啟80端口:firewall-cmd --add-port=80/tcp

啟動mysql:systemctl start mysqld

InfluxDb
配置文件:/etc/influxdb/influxdb.conf
操作:
1、啟動InfluxDb:systemctl start influxdb  或者:influxd 后台啟動:nohup ./influxd
2、查看InfluxDb狀態:systemctl status influxdb
3、停止InfluxDb:systemctl stop influxdb

 

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM