Author:Yan Zeng
E-mail:zengyan16@mails.ucas.edu.cn
License:MIT
This is a set of system scripts, which is used to ensure server security in the public internet.
The scripts can run on Centos7 system.
#Program: this program is a fast setting for new centos 7 system. it should be root to use this program! include function: 1.open ssh service 2.set personal terminal syntax: root and all user 3.etc. #History:
1.add network setting
2.add software shutcuts
1.Add support to centos-8, this script will nolonger support centos7.
2.Add Network Security System Scripts
3.Add vim 8 global configue file 'defaults.vim'
1.change the hostname in license before copy the license.
2.input the new hostname
3.if cae running wrong due to teaching license, then delete the last row of
/opt/DassaultSystemes/SimulationServices/V6R2017x/linux_a64/SMA/site/custom_v6.env
1.input the host name as real hostname
This script analysis /var/log/secure file to find the ip address whose the number of failed times is greater than 3.
Then the script add the ipaddress to /etc/hosts.deny to reject ssh connection.
This script find the ip do the following things
1.Add the ip to firewall drop zone.
2.Add the ip to firewall ipset ssh_drop --permanent
3.This script will NOT add the ip which is already in ipset ssh_drop.
4.You should run the following command to add the ipset into firewall.
firewall-cmd --permanent --zone=public --add-rich-rule="rule family=ipv4 source ipset=ssh_drop drop"
and add the following line in /etc/crontab to run every minite
*/1 * * * * root /usr/local/sbin/drop_ssh_hosts_local.sh 1>&2> /dev/null
If you have a ip list from internet and you want to drop them, then you can save the ip address in a file at /var/log/drop_ssh_hosts_public.
Run this script you can add the ip address in the drop zone in firewall.
This script will NOT add the ip which is already in firewall drop zone.
2019-10-22 updated
This program is for ddns on local host, using bash shell.
This program has less dependence for esay using on a lot of kind of systems.
The jq version depends on jq on your system.