應(yīng)用場景很多,如蚀瘸,中小項目大多使用mysql,那么在你的mysqladmin備份腳本里可能存在明文的密碼庶橱,此時由于公司服務(wù)器可能多個同事使用,那么轉(zhuǎn)碼加密腳本至關(guān)重要贪惹!
1苏章,首先 SHC安裝(建議使用交新版本,如 4.0.3):
源碼下載:
git clone https://gitee.com/wl4g/shc.git
git clone https://github.com/neurobin/shc.git
cd shc
git checkout -b 4.0.3
git pull origin 4.0.3
mkdir -p /usr/local/man/man1
./configure
make all
sudo make install
2奏瞬,使用枫绅,如:
# 動態(tài)編譯
shc -e '01/01/2021' -m 'This script expired, please contact authors!' -f mytest.sh
#靜態(tài)編譯
CFLAGs=-static shc -e '01/01/2021' -m 'This script expired, please contact authors!' -f mytest.sh
# chmod go-r mytest.sh.x # 可選
./mytest.sh.x # 執(zhí)行生成的C二進(jìn)制文件