继续上篇的一些gpg牢骚

来源:互联网 发布:mysql注入点测试 编辑:程序博客网 时间:2024/06/05 04:37

言归正题,由于我是需要自动化部署的脚本经常用到了gpg解密,然后发现一个问题,如果关闭session没有屏幕输出的时候文件不会被解密,但是有会话或者有屏幕输出的时候就没问题,我在想到底什么原因,多半是因为屏幕输出的缘故,刚接手linux不太熟悉一些特性,找到了以下参数

 

--quite gpg Try to be as quiet as possible 就是类似静默模式

--no-tty --batch  Make sure that the TTY (terminal) is never used for any output. This option is needed in some cases because GnuPG sometimes prints warnings to the TTY if --batch is used. 不输出 包含算法缺失提示等等。

--no-mdc-warning Suppress the warning about missing MDC integrity protection. 不提示mdc警告,

 

gpg  --passphrase=your password --load-extension ideadll/idea(idea插件路径)  --quiet  --no-tty --batch --no-mdc-warning  -o *.zip -d *.pgp

 

总结一下:

        1.自动化脚本尽量不要输出,以免造成不必要的问题,有输出的话也重定向到文件

        2.如果使用命令行也需要注意命令行的参数是否有忽略提示的,做到万事小心,切忌。

        3.自动化脚本最好有配置文件,修改非常方便,不需要vi脚本文件去修改比较麻烦。

先这些,以后再说。。。。

 

附:参考链接

http://lists.gnupg.org/pipermail/gnupg-users/2004-October/023489.html问题提出 

http://marc.info/?l=gnupg-users&m=124593935008348问题提出

http://linux.die.net/man/1/gpg gpg命令行详解绝对比gpg --help 丰满,比man gpg 看的舒服

原创粉丝点击