问题描述
运行此代码时出现此错误.
I'm getting this error when I run this code.
gpg --fingerprint
问题似乎出在权限上,但是我已经尝试了这段代码,但似乎并没有改变任何事情.通过nautilus进行检查,我拥有该文件并具有读/写priv.权限,而所有其他权限都设置为"none".
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:~$
推荐答案
使用sudo
运行的命令将以root用户身份运行.您想要做的是以用户 dylan 的身份拥有文件,对吗?
Commands run with sudo
will be run as root. What you want to do is to own the files as your user dylan, right?
也许是这样,root现在正在拥有您的文件.可以通过以下方式更改:
Maybe so happens that root is owning your files now. This can be changed by:
sudo chown -R dylan ~dylan/.gnupg
,然后为dylan
:
chmod 600 ~/.gnupg/gpg.conf
chmod 700 ~/.gnupg
要检查结果:
ls -l ~/.gnupg
ls -ld ~/.gnupg
写ls
后左侧的字母表示:
r
读取访问权限(4),w
写访问权限(2),x
执行访问权限(1)
r
read access (4),w
write access (2),x
execute acess (1)
所以6 = 4 + 2->读写访问权限
So the 6 = 4 + 2 -> read and write access
7 = 4 + 2 + 1->读取,写入和执行访问权限
And the 7 = 4 + 2 + 1 -> read, write and execute access
要进入目录,您需要具有执行权限.
To be able to entering a directory you will need the execute access.
如果要创建一个只能遍历但不能列出文件的目录,则可以执行:chmod 100 the_directory
.
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
.
阅读 chmod(2)手册以获取更多信息.
Read the chmod(2) manual for more information.
这篇关于gpg:警告:配置文件,$ gpg --fingerprint在Ubuntu9.10上的所有权不安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!