脚本写完后,如果要发布给其它人使用的话,可能会因安全原因而受阻,特别是脚本中包含密码等原因,而对脚本加密则可以解决此问题,本文提供了CentOS7/8环境下,加密shell脚本需要安装的程序和方法。
how to encrypt
install shc on CentOS7 or CentOS8, finding installing rpm on
[root@www~] # curl -O https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/shc-4.0.3-1.el7.x86_64.rpm
[root@www~] # rpm -Uvh shc-4.0.3-1.el7.x86_64.rpm
error: Failed dependencies:
ld-linux-aarch64.so.1()(64bit) is needed by shc-4.0.3-1.el7.aarch64
ld-linux-aarch64.so.1(GLIBC_2.17)(64bit) is needed by shc-4.0.3-1.el7.aarch64
[root@www~] # yum -y instal glibc
shc -r -f install.sh -o idp3script