Old boy Education daily-94th Day-shell scripting Knowledge Point: Encrypt shell scripts

Source: Internet
Author: User

Topic

Automated maintenance of the system with shell scripts is simple, convenient and portable.
But shell scripts are read-write and are likely to leak sensitive information, such as usernames, passwords, paths, IP, and so on.
Similarly, sensitive information is also disclosed when a shell script is run.
How do I encrypt a script without affecting the script to run?

Answer reference: Method One: SHC

SHC is a tool for encrypting shell scripts. Its role is to convert the shell script into an executable binary file.
SHC Installation
yum -y install shc
How to use:
shc -r -f script-name 注意:要有-r选项, -f 后跟要加密的脚本名.
Two files will be generated after running, script-name.x and SCRIPT-NAME.X.C
Script-name.x is an executable binary file after encryption.
./script-name can be run.
SCRIPT-NAME.X.C is the original file that generated the script-name.x (C language)

Method Two: Gzexe

The system comes with no installation.
Use the following command to encrypt:
gzexe tesh.sh
When encryption is complete, test.sh is the encrypted file, and the source file is backed up as test.sh~.
Encryption compresses files at the same time
The encryption function is weak and can only meet the general requirements.
There may be a risk that the script will not execute properly after encryption

Note

Today is the 94th Day of the day to accompany you and look forward to your progress .

For questions and answers, please leave a comment in the blog comments section .
Index of the topic of the previous period

http://lidao.blog.51cto.com/3388056/1914205

This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1948922

Old boy Education daily-94th Day-shell scripting Knowledge Point: Encrypt shell scripts

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.