GnuPG (GNU Privacy Guard) 是加密界的“瑞士军刀”。虽然它最常用于电子邮件和数字签名,但它也是加密文件和目录归档的最佳工具之一。GnuPG支持文件/目录的加密操作,使用简单。
使用GnuPG加密文件
没有安装的需要执行下面的命令进行安装:
# 1. 确保 GnuPG 已安装
sudo apt install gnupg
加密文件命令示例:
gpg -c my_document.txt
# encrypted_file为加密后的文件名
gpg -c -o encrypted_file.gpg secret.txt
使用GnuPG解密文件
# 系统会提示您输入解密密码
gpg my_document.txt.gpg
# 指定输出文件名
gpg -d [加密文件名] > [输出文件名]

![[解决]apt update报错 no longer has a Release file.-创世ai](https://www.maizongai.com/wp-content/uploads/2025/08/debian-logo.png)






评论前必须登录!
注册