find
- not find subfolder
find . -maxdepth 1 -type f
cp only files exclude currect folder
find . -maxdepth 1 -type f | xargs -i cp {} target/
NTP update
ntpupdate ip
date -s dd:mm:ss
ntp开机自启动
chkconfig ntpd on
chkconfig ntpd off
chkconfig ntpd --level 23 on
chkconfig ntpd --level 23 off
Solaris11 root无法SSH登陆
vi /etc/user_attr
#root::::type=role或者root::::type=normal
vi /etc/ssh/sshd_config
PermitRootLogin yes
svcadm restart ssh
Solaris11 block ip port
- echo ‘block out log quick proto tcp from any to any port = 3306’
- echo ‘block in log quick proto tcp from any to any port = 3306’
- svcadm disable svc:/network/ipfilter:default
- sleep 2
- svcadm enable svc:/network/ipfilter:default
- sleep 2
Linux block and unblock ip port
refer to https://www.basezap.com/block-unblock-ip-address-linux/}
Requirements
Root Access to the Linux System
Procedure
Login to the server as the root user
Follow the Syntax below for various iptables rules.
Note – Replace IP-ADDRESS-HERE with the particular IP address and port_number with the port.
Add iptables rule to block IP Address
iptables -A INPUT -s IP-ADDRESS-HERE -j DROP
Add iptables rule to block IP Address access to a specific port
iptables -A INPUT -s IP-ADDRESS-HERE -p tcp --destination-port port_number -j DROP
Drop/Remove iptables rule to unblock IP Address
iptables -D INPUT -s IP-ADDRESS-HERE -j DROP
Drop/Remove iptables rule to unblock IP Address access to a specific port
iptables -D INPUT -s IP-ADDRESS-HERE -p tcp --destination-port port_number -j DROP
After adding/removing any of the above rules we need to save the iptables rules by the following command.
iptables-save
With these few commands, we finish the iptables block and unblock rules.
Check/Verify if a particular IP is blocked using iptables.
iptables -L INPUT -v -n | grep “IP-ADDRESS-HERE”
BLOCK CONN to MYSQL
iptables -I OUTPUT -p tcp --destination-port 3306 -j DROP --INSERT TO DEFAULT
iptables -A OUTPUT -p tcp --destination-port 3306 -j DROP --ADD
iptables -D OUTPUT -p tcp --destination-port 3306 -j DROP --DROP
本文介绍如何使用Linux下的iptables命令来封禁或解除封禁特定IP地址及端口的方法。涵盖添加规则以阻止IP访问、阻止特定端口访问、删除规则以解除封禁等内容,并提供保存规则的方法。

被折叠的 条评论
为什么被折叠?



