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