前因后果 1.在跳板机上使用ansible命令测试机器B时,报错如下,于是就怀疑是网络防火墙的问题 10.10.0.86 | FAILED >> { "failed": true, "msg": "/bin/sh: /usr/bin/python: No such file or directory\r\nOpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1:…
从网上得知 /etc/resolv.conf中的DNS配置是从/etc/resolvconf/resolv.conf.d/head中加载而来,所以每回改resolv.conf都会失效,在此文件里面已经有说明 打开/etc/resolv.conf内容如下:cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)# DO NOT EDIT THIS FILE…
从网上得知 /etc/resolv.conf中的DNS配置是从/etc/resolvconf/resolv.conf.d/head中加载而来,所以每回改resolv.conf都会失效,在此文件里面已经有说明 打开/etc/resolv.conf内容如下:cat /etc/resolv.conf Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)# DO NOT EDIT THIS FILE BY…
RedHat和SUSE系列下有比较好用的iptables管理工具,可以像控制服务进程一样来对防火墙进行管理及控制,Debian系发行版默认不开启iptables,当然也没有与之相关的能直接管理的工具了.正常情况下,我们写入的iptables规则将会在系统重启时消失.即使我们使用iptables-save命令将iptables规则存储到文件,在系统重启后也需要执行iptables-restore操作来恢复原有规则.Debian有两种方法可以让系统重启时规则不消失也就是实现持久化iptables规则…
ifconfig 命令用于查看网络相关的命令: 安装:yum install net-tools -y  ifdown  eth_name  关闭网卡  ifup  eth_name   开启网卡 配制虚拟网卡: 编辑的内容: DEVICE=bond:1BONDING_OPTS="updelay=0 resend_igmp=1 use_carrier=1 miimon=100 arp_all_targets=any min_links=0 downdelay=0 xmit_hash_policy…
iptables规则备份和恢复 保存和备份iptables规则Service iptables save //会把规则保存到/etc/sysconfig/iptables把iptables规则备份到my.ipt文件中Iptables-save > my.ipt恢复刚才备份的规则iptables-restore < my.ipt firewalld的9个zone 打开firewalld,禁掉iptablessystemctl  disable iptablessystemctl stop ipt…
很多时候,我在我自己的VPS上面部署了Cobalt Strike,可是网上很多叼毛就会扫描我们的VPS,然后发现我们的Cobalt Strike,如果你还建有web delivery,还会被人家下载上线,你想想,你的客户端突然上线一个莫斯科的IP,你怕不怕是卡巴斯基的呢?怕不怕APT报告的主角就是你呢?哈哈!还有一些爬虫,我们可以也ben掉. BANd掉来自163.172.160.182的所有请求 iptables -I INPUT -s 163.172.160.182 -j DROP 保存当前…
一.iptables规则备份和恢复 保存和备份iptables规则 service iptables save //会把规则保存到 /etc/sysconfig/iptables 把iptables规则备份到my.ipt文件中 iptables-save > my.ipt 恢复刚才备份的规则 iptables-restore < my.ipt 二.firewalld的9个zone 打开firewalld systemctl disable iptables systemctl stop ipt…
新配置的一台服务器,安装的是CentOS6.3系统,在安装完LNMP之后,发现nginx进程存在,且php解析正常,但是用分配的独立IP去访问的时候发现无法访问. 查了下网上的资料,发现可能是Linux防火墙iptables导致nginx不能访问.我们访问一个网站,一般用的是80端口,那么这个问题的原因可能就是80端口的访问被拦截了.查看/etc/sysconfig/iptables文件,发现里面没有80端口的配置规则,需要修改下iptables. 在root权限下执行: iptables -A…
编写systemd文件 $ sudo vi /etc/systemd/system/iptables-import.service # /etc/systemd/system/iptables-import.service [Unit] Description=Iptables rules import After=docker.service [Service] Type=simple ExecStart=/home/<用户名>/iptables_import.sh RemainAfterE…