How to get the shell encrypt tool SHC

Purpose: This blog entry will explain how to encrypt a shell script on your Linux or a Unix based system. Although there might be other ways to encrypt your shell script I found this one the most easiest to use. We will encrypt the script using the shc utility.  I have been using this utility since last 3 years and it works great in situations where you want users to execute the shell script but at the same time you don’t want them to see the source code of the shell script. So let’s get started…

Step 1: Download or obtain the source

Luckily Debian Etch has “.deb” package for the shc utility so we will use it.  On a Debian Etch system do:

 

# apt-get update;
# apt-get install shc

 

Now go to step 3 if you are on a Debian Etch system. If you are on a Lenny system then follow step 2.

If you are on Debian Lenny system (chances are very high) then you will need to download the “.deb” file from Debian Etch repos. You either download it from here or you can give the following command:

 

# apt-get update; apt-get install wget
# wget http://http.us.debian.org/debian/pool/main/s/shc/shc_3.8.6-2_i386.deb

 

This will download the file named  shc_3.8.6-2_i386.deb into the directory from where you gave the above command.

If you are on a system other than Debian, you can download the tarball from here or by giving the command:

 

fedora# wget http://www.datsi.fi.upm.es/%7Efrosal/sources/shc-3.8.6.tgz

 

Step 2:  Install the “.deb” file (only for users on Debian Lenny or Debian Sid)

 

Once you have downloaded the “.deb” file on your Linux system, install it using dpkg command:

 

# dpkg -i <file-you-downloaded-from-step1>
Example:
# dpkg -i shc_3.8.6-2_i386.deb

 

You only need to do the above on a Lenny system. If you are on a Debian Etch system it gets installed automatically.

 

Link:http://linux.koolsolutions.com/2009/01/20/howto-encrypting-a-shell-script-on-a-linux-or-unix-based-system/

你可能感兴趣的:(shell,shc)