使用tar使用密码压缩tar.gz文件 [英] Use tar to compress file tar.gz with password

查看:102
本文介绍了使用tar使用密码压缩tar.gz文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 tar -czf test.tar.gz test/ test forlder压缩为 test.tar.gz .现在,我想用密码"mypass" 压缩到 test.tar.gz ,该怎么办?

I use tar -czf test.tar.gz test/ to compress test forlder to test.tar.gz . Now, I want compress to test.tar.gz with password "mypass" How can I do?

推荐答案

tar格式 gz格式都没有内置的密码保护文件支持.

上使用crypt或gpg请参考加密-并使用密码解密文件以获取更多信息.

Neither the tar format nor the gz format has built-in support for password-protecting files.
Use crypt or gpg on the
Refer this encrypt-and-decrypt-files-with-a-password for more info.

tar cvvjf - /path/to/files | ccrypt > backup.tar.bz2.cpt

ccrypt backup.tar.bz2

您也可以使用zip

You can also use zip

zip -e file.zip file

将在提示您询问密码时询问您.然后,通过 zip -P password 通过命令行传递密码会更加安全.

Will ask you on a prompt for a password. It is more secure then passing the password via the command line via zip -P password.

这篇关于使用tar使用密码压缩tar.gz文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆