Linux之Shell 脚本加密工具-shc

Much effort, much prosperity.

为什么要加密Shell脚本呢?当然是为了安全!

可能脚本里面涉及到密码之类的就需要进行加密了

一、下载安装shc工具

要保护自己编写的shell脚本程序,方法有很多,最简单的方法有两种:1、加密 2、设定过期时间,下面以shc工具为例说明:

shc是一个加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件.

[root@localhost ~]# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz
[root@localhost ~]# tar xf shc-3.8.7.tgz
[root@localhost ~]# cd shc-3.8.7
[root@localhost shc-3.8.7]# mkdir /usr/local/shc
[root@localhost shc-3.8.7]# make test
[root@localhost shc-3.8.7]# make
[root@localhost shc-3.8.7]# make test
[root@localhost shc-3.8.7]# make strings
[root@localhost shc-3.8.7]# make install    #这步需要有root权限

进行加密

[root@localhost test]# ls
script.sh
[root@localhost test]# cat script.sh
#!/bin/bash
echo "123123"
echo "123123"
echo "123123"
echo "123123"
echo "123123"
echo "123123"
echo "123123"
[root@localhost test]# shc -r -f script.sh
[root@localhost test]# ls
script.sh  script.sh.x  script.sh.x.c
[root@localhost test]# ./script.sh.x
[root@localhost test]# ./script.sh.x
123123
123123
123123
·····

转载于:https://www.cnblogs.com/LuckWJL/p/8342882.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值