iptables

MySql脚本

感情迁移 提交于 2020-07-24 09:13:24
#!/bin/bash A() { file="/root/mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz" if [ ! -f "$file" ]; then echo "mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz does not exist,need Upload it to /root directory" exit 0 else echo "mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz is exist!!!" fi if [ `whoami` != "root" ];then echo "root is no" exit 0 else echo "root is ok" fi a=`cat /etc/redhat-release |awk 'NR==1' | awk -F '[ ]+' '{print $4}'| cut -d . -f 1` if [ $a != "7" ];then echo "centos7.X is no" exit 0 else echo "centos7.X ok" fi } IPtables() { systemctl stop firewalld.service systemctl disable firewalld

Forwarding traffic from 80 to 8080 [closed]

∥☆過路亽.° 提交于 2020-06-25 21:41:06
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question I have tomcat installed with puppet. It runs on standard 8080 port. The tomcat process is started as tomcat user. I'd like to redirect all traffic from port 80 to 8080. My iptables settings look as follows: Nat: # iptables -L -t nat Chain PREROUTING (policy ACCEPT

Forwarding traffic from 80 to 8080 [closed]

风流意气都作罢 提交于 2020-06-25 21:40:47
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question I have tomcat installed with puppet. It runs on standard 8080 port. The tomcat process is started as tomcat user. I'd like to redirect all traffic from port 80 to 8080. My iptables settings look as follows: Nat: # iptables -L -t nat Chain PREROUTING (policy ACCEPT

Running docker container : iptables: No chain/target/match by that name

穿精又带淫゛_ 提交于 2020-06-23 22:23:06
问题 I'm trying to run a container but I get the following issue : Error response from daemon: Cannot start container b005715c40ea7d5821b15c44f5b7f902d4b39da7c83468f3e5d7c042e5fe3fbd: iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.43 --dport 80 -j ACCEPT: iptables: No chain/target/match by that name. (exit status 1) Here is the command I use : docker run -d -p 10080:80 -v /srv/http/website/data:/srv/http/www/data -v /srv/http/website/logs:/srv/http

Restrict Docker exposed port from only specific IP adresses

喜夏-厌秋 提交于 2020-05-27 05:33:08
问题 How to restrict a container's port exposed by Docker from only a list of IPs? Only this list of IP would be able to access this port. I tried that: iptables -I DOCKER -p tcp --dport PORT_X -j REJECT --reject-with icmp-port-unreachable iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_1 --destination HOST_IP_1 -j ACCEPT iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_2 --destination HOST_IP_1 -j ACCEPT iptables -I DOCKER -p tcp --dport PORT_X --source EXTERNAL_IP_3 -

How to run node.js as non-root user?

Deadly 提交于 2020-05-24 19:52:44
问题 I'm running a node.js server, that will serve requests on port 80 amongst others. Clearly this requires the application running as root (on Linux). Looking at this post (http://syskall.com/dont-run-node-dot-js-as-root) as an example it's clear that there are simple ways to allow node to be run as a non-root user, but I'm wondering if anyone has views on the advantages/disadvantages of the different methods suggested: code: use setuid() to drop down from root to non-priviledged user after

How to run node.js as non-root user?

孤者浪人 提交于 2020-05-24 19:49:32
问题 I'm running a node.js server, that will serve requests on port 80 amongst others. Clearly this requires the application running as root (on Linux). Looking at this post (http://syskall.com/dont-run-node-dot-js-as-root) as an example it's clear that there are simple ways to allow node to be run as a non-root user, but I'm wondering if anyone has views on the advantages/disadvantages of the different methods suggested: code: use setuid() to drop down from root to non-priviledged user after

2 iptables rules I don't understand

落爺英雄遲暮 提交于 2020-05-11 15:00:07
问题 Could anyone explain the following rules: -A default-INPUT -p tcp -m tcp --sport 0:1023 ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT I think I added them to prevent SYN flood but I'm not sure. 回答1: -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT append rule to the INPUT chain -m state load the state module --state RELATE,ESTABLISHED using the state module to match on related or established connections -j

2 iptables rules I don't understand

只愿长相守 提交于 2020-05-11 14:59:06
问题 Could anyone explain the following rules: -A default-INPUT -p tcp -m tcp --sport 0:1023 ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT I think I added them to prevent SYN flood but I'm not sure. 回答1: -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT append rule to the INPUT chain -m state load the state module --state RELATE,ESTABLISHED using the state module to match on related or established connections -j

2 iptables rules I don't understand

流过昼夜 提交于 2020-05-11 14:58:09
问题 Could anyone explain the following rules: -A default-INPUT -p tcp -m tcp --sport 0:1023 ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT I think I added them to prevent SYN flood but I'm not sure. 回答1: -A default-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT append rule to the INPUT chain -m state load the state module --state RELATE,ESTABLISHED using the state module to match on related or established connections -j