Aug 11th, 2009
How to Encrypt Shell Script
How to Encrypt Shell Script
We all know that anyone can read shell script.Think if any one gets access to the shell script which has root password and all stored in it. Its really a security risk. Now we have a solution for that ie all this risk can be avoided if the shell script is encrypted and then executed. The utility used for that is called shc
I will explain how to install it and then use it for the encrypting purpose
1) Download from http://www.datsi.fi.upm.es/~frosal/sources/shc-3.7.tgz
2) Untar it
3) To install it follow the below given steps
make
make install
4) After install it will create a binary called shc, use it to encrypt the shell scripts
5) Write a shell script, lets call it heloworld.sh
echo ” Helo world ”
6) To test shc execute the command
Option -f is used to encrypt
7) Now you will get an encrypted version of the script. It will be named something like heloworld.sh.x
Its an encrypted version and you can execute it as you wish
9) You have an encrypted shell script.