使用shc工具加密shell程序
shc工具c写一个脚本加密工具,加密后的脚本会变成二进制可执行程序。
shc来对脚本加密,加密后完全是二进制字符,不易破解。比linux系统自带一款加密工具gzexe好。
安装
wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz
tar -zxvf shc-3.8.9.tgz
cd shc-3.8.9
make
ln -s /usr/src/shc-3.8.9/shc /usr/bin/
使用
shc -r -T -e “1/6/2017” -m “this file is expiration date.” -f backup_fffmo.com.sh
-e date (指定过期时间 设置脚本过期时间)
-m message (指定过期提示的信息)
-f script_name (指定要编译的shell路径)
-r relax security (在不同操作系统执行)
-v Verbose compilation (输出编译的详细情况)
加密的过程中会生成两个文件*.sh.x 和 *.sh.x.c,
*.sh.x.c 是脚本的源文件,可删除。
*.sh.x就是原来脚本的可执行文件,可随意改名,可直接执行。