(1)gzexe加密
[root@ECS iclound]# ifconfig >>ip.txt
[root@ECS iclound]# gzexe ip.txt
[root@ECS iclound]# gzexe -d ip.txt //解密
(2)用tar命令对文件进行加密
[root@ECS iclound]# tar -zcf - ip.txt | openssl des3 -salt -k pwd@123 | dd of=ip_en.txt.des3
[root@ECS iclound]# dd if=ip_en.txt.des3 | openssl des3 -d -k pwd@123 | tar zxf -
(3)用tar结合openss对文件进行加密
[root@ECS iclound]# tar -czf -* | openssl enc -e -aes256 -out ip.txt.tar.gz
[root@ECS iclound]# openssl enc -d -aes256 -in ip.txt.tar.gz | tar xz -C /root/
(4)用shc加密(仅仅对shell脚本加密)
shc是一个专业的加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件,这个办法很好的解决了脚本中含有IP、密码等不希望公开的问题。
[root@ECS iclound]# cd /usr/local/src/
[root@ECS src]# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz
[root@ECS src]# tar -zvxf shc-3.8.9.tgz
[root@ECS shc-3.8.9]# mkdir -p /usr/local/man/man1
[root@ECS shc-3.8.9]# make install
[root@ECS iclound]# shc -r -f 01.sh //生成二进制
[root@ECS iclound]# ls -l
总用量 28
-rw-r--r-x 1 root root 33 12月 17 14:08 01.sh
-rwx--x--x 1 root root 11232 12月 17 14:09 01.sh.x
-rw-r--r-- 1 root root 9467 12月 17 14:09 01.sh.x.c
(5)用ZIP加密
[root@ECS iclound]
Enter password:
Verify password:
adding: ip.txt (deflated 71%)
[root@ECS iclound]
[root@ECS iclound]
Archive: ip.txt.zip
[ip.txt.zip] ip.txt password:
(6)用GnuPG加密
GnuPG全程是GNU隐私保护,通常称为GPG,通常只能针对文件加密无法对文件夹加密
[root@ECS iclound]# yum -y install gnupg
[root@ECS iclound]# gpg2 -c ip.txt //加密
[root@ECS iclound]# gpg2 ip.txt.gpg //解密
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)