Linux 加密shell脚本

shc-3.7.tgz   以上的版本都能直接在64位的机器上运行

shc-3.6.tgz 包括3.6适合在32位系统

http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz      --------------------------------------》       shc-3.8.9b.tgz

[root@localhost ~]# rpm -q gcc gcc-c++    如果没有安装,请执行下面命令

[root@localhost ~]# yum -y install gcc gcc-c++

[root@localhost ~]# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.7.tgz

[root@localhost ~]#tar -xf shc-3.7.tgz

[root@localhost aaf# cd shc-3.7

[root@localhost aaf#make install

[root@localhost aaf#   请按Y

[root@localhost aaf# shc    验证      出现以下信息就是说明安装成功

shc parse(-f): No source file specified

shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-rvDTCAh] -f script

[root@localhost shc-3.7]# shc -rv(输出详细信息) -f aa(script-name)             生成静态可执行的二进制文件 ,出现以下信息就是正确的。aa.x是加密后的shell可执行文件,不信可以nl  cat 看看

shc shll=bash 
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc aa.x.c -o aa.x
aa.x.c: In function 'chkenv':
aa.x.c:196: warning: cast from pointer to integer of different size
shc: strip aa.x

 #  wget  http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.6.tgz   从这里下载的包跟3.6版本是一样的

#  wget  http://www.datsi.fi.upm.es/~frosal/sources/shc-3.6.tgz    这是3.6版本的

[root@nagios-client ~]# tar -xf shc-3.8.6.tgz 

[root@nagios-client ~]# cd shc-3.8.6

[root@nagios-client shc-3.8.6]# make install
*** Installing shc and shc.1 on /usr/local
*** ¿Do you want to continue? y
install -c -s shc /usr/local/bin/
install -c -m 644 shc.1 /usr/local/man/man1/
install: 目标"/usr/local/man/man1/" 不是目录: 没有那个文件或目录
make: *** [install] 错误 1

[root@nagios-client shc-3.8.6]# mkdir -p /usr/local/man/man1

[root@nagios-client shc-3.8.6]# make install
*** Installing shc and shc.1 on /usr/local
*** ¿Do you want to continue? y
install -c -s shc /usr/local/bin/
install -c -m 644 shc.1 /usr/local/man/man1/    这才是正确的信息

[root@nagios-client shc-3.8.6]# yum install glibc.i686  ld-linux.so.2 一定要安装        包没有多大的  安装的时候不能有报错

原文地址:https://www.cnblogs.com/fyy-hhzzj/p/shc-shell-secrect.html