Wednesday, August 15, 2012

How to secure/encrypt the shell script.!

If you wanted to encrypt the shell script, Or you need to do secure the shell script. Please use this tool.

Install with (binary) source.
# wget
# tar xvfz shc-3.8.7.tgz
# cd shc-3.8.7
# make

Install with Yum repository.

yum install shc -y

Run the script with sevral options.

$ ./shc -v
shc parse(-f): No source file specified

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

Create the test shell script.
#! /bin/bash

echo " Hey Hello.!"

If installed with yum please do this

$ shc -f
After run this command you will find two more file with the name as follows.
Original file :
C compile file : filename.x.c
Encripted File: filename.x

And if you run the command like:

o/p: Hey Hello.!