gpg:警告:配置文件的所有权不安全,Ubuntu9.10 上的 $gpg --fingerprint [英] gpg: WARNING: unsafe ownership on configuration file, $gpg --fingerprint on Ubuntu9.10

查看:63
本文介绍了gpg:警告:配置文件的所有权不安全,Ubuntu9.10 上的 $gpg --fingerprint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行此代码时出现此错误.

gpg --fingerprint

<块引用>

gpg:警告:不安全的所有权配置文件`/home/dylan/.gnupg/gpg.conf

问题似乎出在权限上,但我已经尝试过这段代码,它似乎没有改变任何事情.通过 nautilus 检查,我拥有该文件并具有读/写权限,而所有其他权限都设置为无".

sudo chmod 600 ~/.gnupg/gpg.conf

<小时>

dylan@Majuscule:~$ sudo chown -R dylan ~dylan/.gnupg[sudo] dylan 的密码:dylan@Majuscule:~$ chmod 600 ~/.gnupg/gpg.confdylan@Majuscule:~$ chmod 700 ~/.gnupgdylan@Majuscule:~$ gpg --fingerprintdylan@Majuscule:~$ sudo gpg --fingerprintgpg:警告:配置文件/home/dylan/.gnupg/gpg.conf"的所有权不安全dylan@Majuscule:~$ ls -al/home/dylan/.gnupg共 24 个drwx------ 2 迪伦迪伦 4096 2010-02-02 13:46.drwxr-xr-x 60 迪伦迪伦 4096 2010-02-02 13:43 ..-rw------- 1 迪伦迪伦 9364 2010-01-27 06:34 gpg.conf-rw------- 1 迪伦迪伦 0 2010-01-27 06:34 pubring.gpg-rw------- 1 迪伦迪伦 0 2010-01-27 06:34 secring.gpg-rw------- 1 dylan dylan 40 2010-01-27 06:34 trustdb.gpgdylan@Majuscule:~$

解决方案

使用 sudo 运行的命令将以 root 身份运行.您想要做的是以您的用户 dylan 的身份拥有这些文件,对吗?

也许 root 现在拥有您的文件.这可以通过以下方式更改:

sudo chown -R dylan ~dylan/.gnupg

然后作为 dylan:

chmod 600 ~/.gnupg/gpg.confchmod 700 ~/.gnupg

检查结果:

ls -l ~/.gnupgls -ld ~/.gnupg

ls后左边的字母表示:

r 读访问 (4),w 写权限(2),x 执行访问(一)

所以 6 = 4 + 2 -> 读写访问

和 7 = 4 + 2 + 1 -> 读、写和执行访问

为了能够进入目录,您需要执行访问权限.

如果你想创建一个只能遍历但不能列出文件的目录,你可以这样做:chmod 100 the_directory.

阅读chmod(2) 手册了解更多信息.

I'm getting this error when I run this code.

gpg --fingerprint

gpg: WARNING: unsafe ownership on configuration file `/home/dylan/.gnupg/gpg.conf

The problem seems to be with permissions, but I have tried this code, and it has not seemed to change a thing. Checking through nautilus, I own the file and have read/write priv., and all others set to 'none'.

sudo chmod 600 ~/.gnupg/gpg.conf


dylan@Majuscule:~$ sudo chown -R dylan ~dylan/.gnupg
[sudo] password for dylan: 
dylan@Majuscule:~$ chmod 600 ~/.gnupg/gpg.conf
dylan@Majuscule:~$ chmod 700 ~/.gnupg
dylan@Majuscule:~$ gpg --fingerprint
dylan@Majuscule:~$ sudo gpg --fingerprint
gpg: WARNING: unsafe ownership on configuration file `/home/dylan/.gnupg/gpg.conf'
dylan@Majuscule:~$ ls -al /home/dylan/.gnupg
total 24
drwx------  2 dylan dylan 4096 2010-02-02 13:46 .
drwxr-xr-x 60 dylan dylan 4096 2010-02-02 13:43 ..
-rw-------  1 dylan dylan 9364 2010-01-27 06:34 gpg.conf
-rw-------  1 dylan dylan    0 2010-01-27 06:34 pubring.gpg
-rw-------  1 dylan dylan    0 2010-01-27 06:34 secring.gpg
-rw-------  1 dylan dylan   40 2010-01-27 06:34 trustdb.gpg
dylan@Majuscule:~$ 

解决方案

Commands run with sudo will be run as root. What you want to do is to own the files as your user dylan, right?

Maybe so happens that root is owning your files now. This can be changed by:

sudo chown -R dylan ~dylan/.gnupg

and then as dylan:

chmod 600 ~/.gnupg/gpg.conf
chmod 700 ~/.gnupg

To check the result:

ls -l ~/.gnupg
ls -ld ~/.gnupg

The letters to the left after writing ls means:

r read access (4), w write access (2), x execute acess (1)

So the 6 = 4 + 2 -> read and write access

And the 7 = 4 + 2 + 1 -> read, write and execute access

To be able to entering a directory you will need the execute access.

If you want to create a directory where it is only possible to traverse but not list the files, you can do: chmod 100 the_directory.

Read the chmod(2) manual for more information.

这篇关于gpg:警告:配置文件的所有权不安全,Ubuntu9.10 上的 $gpg --fingerprint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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