Chinaunix首页 | 论坛 | 博客
  • 博客访问: 140596
  • 博文数量: 68
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 720
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-28 20:01
文章分类

全部博文(68)

文章存档

2015年(68)

我的朋友

分类: 系统运维

2015-08-31 17:31:25

简介:

日常维护中经常需要使用shell脚本来做一些如登录ftp上传、下载日志及其他文件的事,脚本里面包含了ftp的IP、用户名和密码,为安全起见,不想公开这些信息,google了一下,找到了shc。shc是一个可以将shell文件转成二进制文件的小工具,通过它可以很好的解决shell脚本里面包含了不想让别人知道信息的问题。

安装:

# wget ~frosal/sources/shc-3.8.7.tgz

# tar zxvf  shc-3.8.7.tgz

# cd shc-3.8.7

#make

#make install

使用方法:

# shc -h 

shc Version 3.8.7, Generic Script Compiler

shc Copyright (c) 1994-2009 Francisco Rosales <frosal@fi.upm.es>

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

 

    -e %s  Expiration date in dd/mm/yyyy format [none]  #可以设置过期时间

    -m %s  Message to display upon expiration ["Please contact your provider"] #过期后执行时显示的信息

    -f %s  File name of the script to compile

    -i %s  Inline option for the shell interpreter i.e: -e

    -x %s  eXec command, as a printf format i.e: exec('%s',@ARGV);

    -l %s  Last shell option i.e: --

    -r     Relax security. Make a redistributable binary

    -v     Verbose compilation

    -D     Switch ON debug exec calls [OFF]

    -T     Allow binary to be traceable [no]

    -C     Display license and exit

    -A     Display abstract and exit

    -h     Display help and exit

 

    Environment variables used:

    Name    Default  Usage

    CC      cc       C compiler command

    CFLAGS  <none>   C compiler flags

 

    Please consult the shc(1) man page.

使用示例:

# shc -f test.sh

运行后生成两个文件,test.sh.x 和 test.sh.x.c。其中test.sh.x 就是我要需要的加密后的可执行的二进制文件,用./test.sh.x运行; test.sh.x.c是生成test.sh.x的原文件,可以把它删掉

阅读(488) | 评论(0) | 转发(0) |
0

上一篇:icinga-pnp4-cn安装

下一篇:Nginx裁剪图片

给主人留下些什么吧!~~