加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

用户GPG密钥无法被SUDO使用

发布时间:2020-12-13 17:06:33 所属栏目:Linux 来源:网络整理
导读:我创建了一个运行 duplicity的脚本来备份我在VPS上的文件,并使用我作为用户生成的GPG密钥. 当我尝试以SUDO运行此脚本时,我得到: GPGError: GPG Failed,see log below:===== Begin GnuPG log =====gpg: C7B2Y6DO: skipped: public key not foundgpg: [stdin]
我创建了一个运行 duplicity的脚本来备份我在VPS上的文件,并使用我作为用户生成的GPG密钥.

当我尝试以SUDO运行此脚本时,我得到:

GPGError: GPG Failed,see log below:
===== Begin GnuPG log =====
gpg: C7B2Y6DO: skipped: public key not found
gpg: [stdin]: encryption failed: public key not found ===== End GnuPG log =====

现在我意识到这是为什么(因为它不是SUDO的密钥,它是用户密钥)但在我重新生成SUDO密钥之前,是否可以让sudo使用用户密钥?

不是很重要,但脚本是以这三个站点的组合为蓝本的:
http://www.cenolan.com/2008/12/how-to-incremental-daily-backups-amazon-s3-duplicity/

http://www.randys.org/2007/11/16/how-to-automated-backups-to-amazon-s-s3-with-duplicity/

https://help.ubuntu.com/community/DuplicityBackupHowto

解决方法

解:
在bash脚本中添加了以下内容:
HOME=/home/user/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读