From 5695460055a29d0bab2f781b0c5c1050dc5aa0b7 Mon Sep 17 00:00:00 2001 From: suleo <1072089839@qq.com> Date: Thu, 2 Apr 2020 21:09:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9CentOS=5FCheck=5FScript.s?= =?UTF-8?q?h=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++++++- Check_script/bash/CentOS_Check_Script.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e43b0f9..b99e3ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ -.DS_Store +.idea +/tools/.idea/ +/PYJSAC/.idea/ +/unit_test +*~ +*.DS_Store diff --git a/Check_script/bash/CentOS_Check_Script.sh b/Check_script/bash/CentOS_Check_Script.sh index 9bba76e..beb2ca4 100644 --- a/Check_script/bash/CentOS_Check_Script.sh +++ b/Check_script/bash/CentOS_Check_Script.sh @@ -222,7 +222,7 @@ echo "用户错误登入列表:" lastb | head > /dev/null if [ $? == 1 ];then echo ">>>无用户错误登入列表" -then +else echo ">>>用户错误登入--------[需调整]" lastb | head fi From b979b1318947f1af0eb16aa0b4edac04c02c0ad9 Mon Sep 17 00:00:00 2001 From: "jack.xiao" Date: Thu, 6 May 2021 16:48:52 +0800 Subject: [PATCH 2/3] Change the new openroot account --- Protective_Script/CentOS_Protective_Script.sh | 20 +++++++++---------- Protective_Script/README.txt | 4 ++-- README.md | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Protective_Script/CentOS_Protective_Script.sh b/Protective_Script/CentOS_Protective_Script.sh index 2826ff0..4fae880 100644 --- a/Protective_Script/CentOS_Protective_Script.sh +++ b/Protective_Script/CentOS_Protective_Script.sh @@ -128,23 +128,23 @@ fi ################################新增超级管理员用户################################ function create_user(){ echo "#########################################################################################" - echo -e "\033[1;31m 3、Create eproot account \033[0m" + echo -e "\033[1;31m 3、Create openroot account \033[0m" echo "#########################################################################################" - read -p "Be sure to create an eproot account?[y/n]:" + read -p "Be sure to create an openroot account?[y/n]:" case $REPLY in y) - grep -i 'eproot' /etc/passwd + grep -i 'openroot' /etc/passwd if [ $? == 0 ];then - echo -e "\033[1;31m An eproot account has been created \033[0m" + echo -e "\033[1;31m An openroot account has been created \033[0m" else read -p "Please enter your password:" PASSWD - useradd -g root eproot;echo "$PASSWD" | passwd --stdin eproot > /dev/null + useradd -g root openroot;echo "$PASSWD" | passwd --stdin openroot > /dev/null if [ $? == 0 ];then - echo -e "\033[1;31m eproot account created successfully \033[0m" - grep -i "eproot" /etc/sudoers + echo -e "\033[1;31m openroot account created successfully \033[0m" + grep -i "openroot" /etc/sudoers if [ $? != 0 ];then chmod u+w /etc/sudoers > /dev/null - sed -i '/^root.*ALL=(ALL).*$/a\eproot ALL=(ALL) NOPASSWD:ALL' /etc/sudoers > /dev/null + sed -i '/^root.*ALL=(ALL).*$/a\openroot ALL=(ALL) NOPASSWD:ALL' /etc/sudoers > /dev/null if [ $? == 0 ];then echo -e "\033[37;5m [Permissions set success] \033[0m" else @@ -155,7 +155,7 @@ function create_user(){ echo -e "\033[1;31m Permissions have already been set \033[0m" fi else - echo -e "\033[1;31m eproot account created failed \033[0m" + echo -e "\033[1;31m openroot account created failed \033[0m" exit 1 fi fi @@ -354,7 +354,7 @@ function main(){ # Menu # # 1:ALL protective # # 2:Set Password Complexity Requirements # -# 3:Create eproot account # +# 3:Create openroot account # # 4:Set Remote Login Configuration(SSH) # # 5:Set Shell History and TMOUT # # 6:Set SSH Port # diff --git a/Protective_Script/README.txt b/Protective_Script/README.txt index ff5eec5..28b1193 100644 --- a/Protective_Script/README.txt +++ b/Protective_Script/README.txt @@ -14,7 +14,7 @@ 功能说明: 1、ALL protective 一键进行全部加固 2、Set Password Complexity Requirements 设置密码复杂度 -3、Create eproot account 添加eproot账号 +3、Create openroot account 添加openroot账号 4、Set Remote Login Configuration(SSH) 禁止root远程登入 5、Set Shell History and TMOUT 设置history保存行数以及命令时间,设置窗口超时时间 6、Set SSH Port 更改SSH端口 @@ -40,7 +40,7 @@ Date: 2019-03-08 ------------------------ Date: 2019-03-18 -添加新增eproot账号功能,防止系统没有除root账号外的其余账号,配置了禁止root远程,导致系统无法登入 +添加新增openroot账号功能,防止系统没有除root账号外的其余账号,配置了禁止root远程,导致系统无法登入 ---------------------- diff --git a/README.md b/README.md index f074a73..6d0ada0 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ sudo sh CentOS_Protective_Script.sh **功能说明** - 一键进行全部加固 - 设置密码复杂度 -- 添加eproot账号 +- 添加openroot账号 - 禁止root远程登入 - 设置history保存行数以及命令时间,设置窗口超时时间 - 更改SSH端口 From a9eba328a24703f1cd0771350709a1c938291a6e Mon Sep 17 00:00:00 2001 From: "jack.xiao" Date: Mon, 8 Aug 2022 09:19:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Check_script/.DS_Store | Bin 6148 -> 0 bytes Check_script/bash/CentOS_Check_Script.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 Check_script/.DS_Store diff --git a/Check_script/.DS_Store b/Check_script/.DS_Store deleted file mode 100644 index 02de033f9c97028ec0a7b014f00b3b9f08b8cb11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ5Iwu5SKp9X5mJG=E!9WGGfSpJ8>A>Pf0AK>M6YOP{kQ@^*3)p#t2f{uT=u

z JC