In a simple word, SHC compile your Bash script into binary so no one can see your code.
And here's step by step how to install SHC (I use Ubuntu 12.04 LTS) :
1. Download the latest version of SHC at here
2. Put the package at your home (~) directory
3. Extract the tarball :
adee@thinkpad:~$ tar -xzvf shc-3.8.9.tgz shc-3.8.9/CHANGES shc-3.8.9/Copying shc-3.8.9/match shc-3.8.9/pru.sh shc-3.8.9/shc-3.8.9.c shc-3.8.9/shc.1 shc-3.8.9/shc.README shc-3.8.9/shc.html shc-3.8.9/test.bash shc-3.8.9/test.csh shc-3.8.9/test.ksh shc-3.8.9/makefile
4. Step inside into the shc folder and do the 'make' command :
adee@thinkpad:~$ cd shc-3.8.9/ adee@thinkpad:~/shc-3.8.9$ make make: *** No rule to make target `shc.c', needed by `shc'. Stop.
5. As you see above, there's an error about missing file named 'shc.c' Actually the 'shc.c' is already there, we just have to rename / duplicate it into the right name :
adee@thinkpad:~/shc-3.8.9$ cp shc-3.8.9.c shc.c adee@thinkpad:~/shc-3.8.9$ make cc -Wall shc.c -o shc *** �Do you want to probe shc with a test script? *** Please try... make test
6. Ok, then we shall continue to 'make install' command (need sudo):
adee@thinkpad:~/shc-3.8.9$ sudo make install *** Installing shc and shc.1 on /usr/local *** �Do you want to continue? y install -c -s shc /usr/local/bin/ install -c -m 644 shc.1 /usr/local/man/man1/ install: target `/usr/local/man/man1/' is not a directory: No such file or directory make: *** [install] Error
7. Something sucks occurs again. It's looks like there's no such directory named '/usr/local/man/man1/'. So what should we do? Simple, just create that folder and repeat again the make install command. It should works now!
adee@thinkpad:~/shc-3.8.9$ sudo mkdir /usr/local/man/man1 adee@thinkpad:~/shc-3.8.9$ sudo make install *** Installing shc and shc.1 on /usr/local *** �Do you want to continue? y install -c -s shc /usr/local/bin/ install -c -m 644 shc.1 /usr/local/man/man1/
8. Next, we have to move the shc binary file into /bin and give it the excecutable bit :
adee@thinkpad:~/shc-3.8.9$ sudo cp shc /bin/shc adee@thinkpad:~/shc-3.8.9$ sudo chmod +x /bin/shc
9. OK Done! SHC is installed into your system. To test it, try type 'shc' at the terminal, and it should looks like this :
adee@thinkpad:~/shc-3.8.9$ shc shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-rvDTCAh] -f script
OK on the next few days, i will write an article about the usage of SHC. So stay tuned :-)
great post
ReplyDeleteHi,
ReplyDeleteThis post help me,
Thank you.
Great Post! Thats exactly the same errors I had!
ReplyDeleteThanks
Thanks lot .....
ReplyDeleteThanks, very useful!
ReplyDeleteThank you
ReplyDelete[root@localhost shc-3.8.9]# make
ReplyDeletecc -Wall shc.c -o shc
make: cc: Command not found
make: *** [shc] Error 127
you should install gcc before install shc :
Deleteyum -y install make automake autoconf gcc gcc++
apt-get -y install build-essential
aptitude -y install build-essential
thanks!
ReplyDelete[root@localhost shc-3.8.9]# make
ReplyDeletecc -Wall shc.c -o shc
make: cc: Command not found
make: *** [shc] Error 127
lol
install gcc after install shc
yum -y install make automake autoconf gcc gcc++
apt-get -y install build-essential
aptitude -y install build-essential
or mac install xcode command line tools https://developer.apple.com/xcode/
Thanks a lot
ReplyDeleteyour welcome, pete
Deleteon many of machines shc encrypted script running
ReplyDeleteAfter i encrypted it my script did not working.
[root@my shc-3.8.7]# ./op.sh.x
[8]+ Stopped ./op.sh.x
kindly help
install glibc package
Deleteand be careful about shc version. it should be right version with right os release.
This comment has been removed by the author.
ReplyDeletei am having the issue like this kindly help me
ReplyDelete[root@localhost shc-3.8.9]# ./abc.x
[2]+ Stopped ./abc.x
install glibc package
Deleteand be careful about shc version. it should be right version with right os release.