Make linux shell scripts encrypted

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

One day it came to my mind that bash scripts I was developing for a long time (approximately 5000 lines) should be encrypted in order not to be viewed by everyone…

Thanks to heaven there is utility written by Francisco Javier Rosales García SHC that allows to create a stripped binary executable version of the script.

This utility is included into many Linux distributions’ repositories (I’ve used it in Ubuntu and Fedora). To use it in Ubuntu (my laptop operating system) just install it by commands:

apt-get install shc
apt-get install build-essential

The second command installs dependencies for SHC. On my Ubuntu Feisty they weren’t installed automatically during SHC installation and I’ve got errors when compile scripts with SHC (that’s why I’ve installed them explicitly).

When necessary packages are installed compile some script with command:

shc -f script.sh

This command will create script.sh.x which can be run as a regular binary and is encrypted. Moreover this executable can be started only on the machine it’s compiled at (of course until you’ve compiled it with ‘relax security’ option -r).

This utility is also useful to create demo version binaries: it’s possible to set expiration date for the binary.

Respect to the author!

 
 
» You might also be interested in the following articles:
Can’t find usable shell script encryption solution…
Quick shell change for user in Unix or Linux
Get suspend/hibernate working fast in Ubuntu Feisty Fawn (7.04) and Edgy Eft (6.10)
Eject/Close CD or DVD media with shell command
iPhone as network-enabled root shell



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!


Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››