Skip to content

Commit

Permalink
# 保留旧配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo committed Nov 2, 2018
1 parent 8955202 commit 68fd79b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ssh_port.sh
Expand Up @@ -21,8 +21,8 @@ elif [[ -e ${SSH_init_2} ]]; then
else
echo -e "${Error} 找不到 SSH 的服务脚本文件!" && exit 1
fi
bak_text="(可通过备份SSH配置文件复原:[ ${Green_font_prefix}rm -rf /etc/ssh/sshd_config && mv /etc/ssh/sshd_config.bak /etc/ssh/sshd_config && rm -rf /etc/ssh/sshd_config.bak && ${SSH_init} restart${Font_color_suffix} ])"
over_text="${Tip} 当服务器存在外部防火墙时(如 阿里云、腾讯云、微软云、谷歌云、亚马逊云等),需要外部防火墙开放 新SSH端口TCP协议方可连接!"
bak_text="(可通过备份SSH配置文件复原:[ ${Green_font_prefix}rm -rf /etc/ssh/sshd_config && mv /etc/ssh/sshd_config.bak /etc/ssh/sshd_config && ${SSH_init} restart${Font_color_suffix} ])"
over_text="${Tip} 当服务器存在外部防火墙时(如 阿里云、腾讯云、微软云、谷歌云、亚马逊云等),需要外部防火墙开放 新SSH端口TCP协议方可连接!(如使用途中出现任何问题均可通过该代码复原:[ ${Green_font_prefix}rm -rf /etc/ssh/sshd_config && mv /etc/ssh/sshd_config.bak /etc/ssh/sshd_config && ${SSH_init} restart${Font_color_suffix} ] )"

Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[信息]${Font_color_suffix}" && Error="${Red_font_prefix}[错误]${Font_color_suffix}" && Tip="${Green_font_prefix}[注意]${Font_color_suffix}"
Expand Down Expand Up @@ -127,7 +127,7 @@ Direct_modification(){
Add_iptables_ACCEPT
Add_iptables_DROP
Set_iptables
rm -rf /etc/ssh/sshd_config.bak
#rm -rf /etc/ssh/sshd_config.bak
echo -e "${Info} SSH 端口修改成功!新端口:[${Green_font_prefix}${new_port}${Font_color_suffix}]"
echo -e "${over_text}"
fi
Expand Down Expand Up @@ -170,7 +170,7 @@ Conservative_modifications(){
else
Add_iptables_DROP
Set_iptables
rm -rf /etc/ssh/sshd_config.bak
#rm -rf /etc/ssh/sshd_config.bak
echo -e "${Info} 所有配置完成!新端口:[${Green_font_prefix}${new_port}${Font_color_suffix}]"
echo -e "${over_text}"
fi
Expand Down

0 comments on commit 68fd79b

Please sign in to comment.