Two methods of Shell/. sh script encryption in centos linux (shc and gzexe)

Source: Internet
Author: User
Tags centos

Shc method

Shc is a tool for encrypting shell scripts. It converts shell scripts into executable binary files.

Automated maintenance of the system using shell scripts is simple, convenient, and portable.

However, shell scripts can be read and written, and sensitive information such as user name, password, path, and IP address may be leaked.

Similarly, sensitive information is exposed when shell scripts are run.

Shc is a tool for encrypting shell scripts. It converts shell scripts into executable binary files.

This solves the above problems.

Install shc

Yum-y install shc

If yum cannot be installed, go to official download rpm package http://pkgs.repoforge.org/shc/

Usage:

Shc-r-f script-name Note: The-r option must be available.-f is followed by the script name to be encrypted.

Two files, script-name.x and script-name.x.c, are generated after running

The script-name.x is an encrypted executable binary file.

./Script-name to run.

Script-name.x.c is the original file for generating script-name.x (C)

Gzexe method

This encryption method is not very safe, but can meet the general encryption purpose, can conceal the password and other information in the script.

It uses the built-in gzexe program, which not only encrypts but also compresses files.

Usage:

Gzexe file. sh

It backs up unencrypted files as file. sh ~ At the same time, file. sh is converted into an encrypted file;

After that, we generally use the first shc method. Although the later gzexe method is simple, it is not very safe.

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.