如何加密一个sheel脚本!

Posted on 2021-03-05 16:37  开往春天的火车  阅读(235)  评论(0)    收藏  举报

脚本写完后,如果要发布给其它人使用的话,可能会因安全原因而受阻,特别是脚本中包含密码等原因,而对脚本加密则可以解决此问题,本文提供了CentOS7/8环境下,加密shell脚本需要安装的程序和方法。

how to encrypt

install shc on CentOS7 or CentOS8, finding installing rpm onhttps://centos.pkgs.org/, CentOS7 for example:

[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

encrypt install script, CentOS7 encrypt can only using on the same operating system

shc -r -f install.sh -o idp3script

 

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3