linux 中 zip打包 如何添加密码认证? |
您所在的位置:网站首页 › zip压缩文件如何设置密码打开 › linux 中 zip打包 如何添加密码认证? |
linux 中 zip打包 如何添加密码认证?
介绍安装zip命令Linux中创建受密码保护的zip压缩包如何在 Linux 中解压受密码保护的zip压缩包
介绍
Linux 下 怎么保护你的zip压缩包不被被人随意解压? 安装zip命令如果系统中没有zip命令,需要用以下的命令安装。 $ sudo yum install zip [On CentOS/RHEL] $ sudo dnf install zip [On Fedora 22+] $ sudo apt install zip [On Debian/Ubuntu] Linux中创建受密码保护的zip压缩包可以使用 zip带有-P参数的命令来创建一个名为code404.zip的压缩包。 leenhem@leenhem-code404:~/code/tmp$ find . ./code404 ./code404/code404.icu.txt leenhem@leenhem-code404:~/code/tmp$ zip -r -P1234 code404.zip code404 adding: code404/ (stored 0%) adding: code404/code404.icu.txt (deflated 100%) leenhem@leenhem-code404:~/code/tmp$但是上述方法是绝对不安全的,因为这里的密码是在命令行中以明文形式提供的。其次它也将存储在历史文件中(例如.bash_history),这意味着另一个用户可以访问你的帐户(尤其是root用户)将很容易看到密码。 因此可以使用该-e参数,它会显示一个提示,允许你输入隐藏密码。 leenhem@leenhem-code404:~/code/tmp$ rm code404.zip leenhem@leenhem-code404:~/code/tmp$ zip -r -e code404.zip code404 Enter password: Verify password: adding: code404/ (stored 0%) adding: code404/code404.icu.txt (deflated 100%) leenhem@leenhem-code404:~/code/tmp$ 如何在 Linux 中解压受密码保护的zip压缩包解压缩和解密名为的存档文件的内容rumenz.zip, 使用unzip程序并提供你在上面输入的密码。 leenhem@leenhem-code404:~/code/tmp$ unzip code404.zip Archive: code404.zip [code404.zip] code404/code404.icu.txt password: replace code404/code404.icu.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A inflating: code404/code404.icu.txthttps://www.code404.icu/1407.html CSDN_码404:linux 中 zip打包 如何添加密码认证? |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |