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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…