zoukankan      html  css  js  c++  java
  • shc 对 Linux shell 脚本加密.

    shc
    使用 shc 对 Linux shell 脚本加密.
    shc是一个专业的加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件,这个办法很好的解决了脚本中含有IP、密码等不希望公开的问题.
    shc的官网下载地址:
    http://www.datsi.fi.upm.es/~frosal/sources/
    安装:

    [root@localhost ~]# tar xzvf shc-3.8.6.tgz
    [root@localhost ~]# cd shc-3.8.6
    [root@localhost ~]# mkdir -p /usr/local/man/man1

    这步是必须的,不然安装过程中会报错,shc将安装命令到/usr/local/bin/目录下;将帮助文档存放在/usr/local/man/man1/目录下,如果系统中无此目录,安装时会报错,可创建此目录后再执行安装

    [root@localhost ~]# make install

    这是要回答yes或者y,不能直接回车,否则会报错
    使用方法:
    “-f”选项指定需要加密的程序

    [root@localhost ~]# shc -r -f abc.sh 
    [root@localhost ~]# ll
    total 64
    -rw-r--r--. 1 root root    23 Nov 17 11:14 abc.sh
    -rwx--x--x. 1 root root 11520 Nov 17 11:14 abc.sh.x
    -rw-r--r--. 1 root root  9174 Nov 17 11:14 abc.sh.x.c
    drwxr-xr-x. 2 root root  4096 Nov 17 11:13 shc-3.8.7
    -rw-r--r--. 1 root root 20498 Nov 17 11:11 shc-3.8.7.tgz

    运行后会生成两个文件,script-name.x 和 script-name.x.c. 其中script-name.x是加密后的可执行的二进制文件;用./script-name即可运行,script-name.x.c是生成script-name.x的原文件(c语言).
    另shc还提供了一种设定有效执行期限的方法,可以首先使用shc将shell程序转化为二进制,并加上过期时间,如:

    [root@localhost ~]#  shc -e 18/10/2006 -m " It's too late to run this script " -f script.s
  • 相关阅读:
    07.15 first与first-child的区别
    7.15 css与js 选择奇偶子元素的区别
    7.15过有意思的生活
    7.14养成健身习惯
    8080端口被占用
    Vue自定义指令和认识钩子函数
    按键修饰符
    Vue 的过滤器
    列表渲染
    在Vue中使用.class样式
  • 原文地址:https://www.cnblogs.com/syavingcs/p/7850686.html
Copyright © 2011-2022 走看看