Use the SHC tool to encrypt shell script details _linux Shell

Source: Internet
Author: User

SHC can be used to encrypt shell scripts, which can be converted into an executable binary file. After SHC the shell script, it generates two new files at the same time, one is the encrypted executable binary (the filename ends with. x), and the other is the original file in C (the filename ends with the. x.c).

Here's how to install, SHC, and use examples:
Download installation:
(Website download address: http://www.datsi.fi.upm.es/~frosal/sources/)

Copy Code code as follows:

# wget Http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz
# CD shc-3.8.7
# make
# make Install

(Only make can complete the installation, when running SHC to point out absolute path; with make install, install SHC to/usr/local/bin, you can run directly)

Common parameters:
Copy Code code as follows:

-E Date
Expiration date in dd/mm/yyyy format [None] (Specify expiration date)

-M message
Messages to display upon expiration ["Please contact your provider"] (specify expiration prompt information)

-F Script_name
File name of the script to compile (specifies the path and filename of the shell to be compiled)

-R Relax Security.
Make a redistributable binary which executes on different systems the running same system. (can be used in different systems of the same operating system Line

-V Verbose Compilation (details of compilation)


Use examples:
Copy Code code as follows:

[Root@centos54 tmp]#/usr/local/src/shc-3.8.7/shc-e 20/10/2010-m "Lianxi aaa@163.com"-v-r-F./ex.sh

-e: Specify an expiration date of October 20, 2010
-M: Print out information after expiration;
-v:verbose
-R: Can be performed on different hosts on the same operating system
-F: Specify source shell

Method:

Copy Code code as follows:

Shc-r-F Script-name

Note: To have the-r option,-F is followed by the name of the script to be encrypted.
Two files will be generated after the run, script-name.x and SCRIPT-NAME.X.C
Script-name.x is an executable binary file that is encrypted.
./script-name.x can be run.
SCRIPT-NAME.X.C is the original file that generates script-name.x (C language)

Description

After my test, the same in the operating system, the SHC executable binaries can be directly ported to run, but different operating systems may have problems, such as I CentOS5.4 the source shell after the encryption moved to the Redhat As5u4 can not run, appear "floating point Exception "error prompts, but it is no problem to move to another CentOS5.4 to run directly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.