gpt4 book ai didi

passwords - 解压脚本密码

转载 作者:行者123 更新时间:2023-12-04 14:31:40 25 4
gpt4 key购买 nike

好的,这是我的脚本

    #!/bin/bash
cd /var/backups/System/
unzip Themes.zip
exit 0

我需要脚本在解压缩 protected zip 文件(即 Themes.zip)时自动输入密码。由于用户不知道密码,我需要在提取 zip 存档时通过脚本输入密码。希望这使因为?

最佳答案

使用 -P密码标志。来自 man unzip :

-P password
use password to decrypt encrypted zipfile entries (if any). THIS IS INSECURE! Many multi-user operating systems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the-shoulder peeking. Storing the plaintext password as
part of a command line in an automated script is even worse. Whenever possible, use the non-echoing, interactive prompt to enter passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utili-
ties.)

关于passwords - 解压脚本密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11389838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com