# GnuPG secret key [solved]

## k:arel

i'm following this tutorial and have succesfully generated my own keypair and have send it to the keyserver(s)

yet, when i want to send an email to my own with Mozilla (using enigmail), i'm getting this error:

```
Send operation aborted.

Error -encryption command failed

gpg command line and output:

<command>

gpg: skipped '<email>': secret key not available

gpg: [stdin]: clearsign failed: secret key not available
```

it's obvious he can't find my secret key

so i tried to import it with KGpg (i have tried to import both my Public Key as my revocation file) which gives:

while importing Public Key (karel.asc):

```
gpg: failed to create temporary file `//.#lk0x8100284.karelDT.10454': Permission denied

gpg: keyblock resource `//secring.gpg': general error

gpg: failed to create temporary file `//.#lk0x8100284.karelDT.10454': Permission denied

gpg: keyblock resource `//pubring.gpg': general error

gpg: no writable keyring found: eof

gpg: error reading `/home/karel/karel.asc': general error

gpg: import from `/home/karel/karel.asc' failed: general error

gpg: Total number processed: 0

[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```

where would he create that temporary file? maybe that directory's messed up?

while importing revocation file (revoke.asc):

```
gpg: failed to create temporary file `//.#lk0x8100284.karelDT.10455': Permission denied

gpg: keyblock resource `//secring.gpg': general error

gpg: failed to create temporary file `//.#lk0x8100284.karelDT.10455': Permission denied

gpg: keyblock resource `//pubring.gpg': general error

gpg: key 2506386E: no public key - can't apply revocation certificate

gpg: Total number processed: 1

[GNUPG:] IMPORT_RES 1 0 0 0 0 0 0 0 0 0 0 0 0 0
```

(here KGpg says my key is processed, but still isn't showing it)

i've set up GNUpg as root and after getting some write errors, i've re-owned my home dir files:

```
# chown karel /home/karel/* -Rv
```

my gpgp output:

```
$ gpg --list-keys

/home/karel/.gnupg/pubring.gpg

------------------------------

pub   1024D/2506386E 2005-02-16 [expires: 2007-02-16]

uid                  Karel Nijs (LinuxMail.org adres) <k.arel@linuxmail.org>

uid                  Karel Nijs <karel@karelnijs.be>

uid                  Karel Nijs (GMail adres) <karelnijs@gmail.com>

sub   1024g/B31B6EFE 2005-02-16 [expires: 2007-02-16]

$ gpg --list-secret-keys

"nothing"
```

anybody any idea what to do?

i've checked GNUpg's  "5.7) PGP does not like my secret key."

but i can't export my secret keys, if i have none...

----------

## JPMRaptor

Do you have the file /home/karel/.gnupg/secring.gpg?  When I do "gpg --list-secret-keys" it says that's the file with the secret keys.  Maybe something got screwed up between generrating the key and trying to use it.

----------

## k:arel

```
$ ls -l /home/karel/.gnupg/secring.gpg

-rw-------  1 karel users 1069 Feb 17 19:32 /home/karel/.gnupg/secring.gpg
```

after creating another key with KGpg, i can list my secret key:

```
$ gpg --list-secret-keys

/home/karel/.gnupg/secring.gpg

------------------------------

sec   1024D/264824AC 2005-02-17 [expires: 2007-02-17]

uid                  Karel Nijs (GMail adres) <karelnijs@gmail.com>

ssb   1024g/D1A0820E 2005-02-17
```

but i still can't use it with KGpg: when refreshing my keys, there still none showing

when i'm in the KGpg Editor, i can't Encrypt or Sign my message because there are no keys available

while importing karel.asc KGpg still complains:

```
gpg: failed to create temporary file `//.#lk0x8100284.karelDT.12313': Permission denied

gpg: keyblock resource `//secring.gpg': general error

gpg: failed to create temporary file `//.#lk0x8100284.karelDT.12313': Permission denied

gpg: keyblock resource `//pubring.gpg': general error

gpg: no writable keyring found: eof

gpg: error reading `/home/karel/karel2.asc': general error

gpg: import from `/home/karel/karel2.asc' failed: general error

gpg: Total number processed: 0

[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```

while importing revoce2.asc:

```
gpg: failed to create temporary file `//.#lk0x8100284.karelDT.12355': Permission denied

gpg: keyblock resource `//secring.gpg': general error

gpg: failed to create temporary file `//.#lk0x8100284.karelDT.12355': Permission denied

gpg: keyblock resource `//pubring.gpg': general error

gpg: key 264824AC: no public key - can't apply revocation certificate

gpg: Total number processed: 1

[GNUPG:] IMPORT_RES 1 0 0 0 0 0 0 0 0 0 0 0 0 0
```

i'm a little confused here: i shouldn't be importing my revoce2.asc file, don't i?

while browsing throught the KGpg settings i noticed: 

```
GnuPG Home:

Configuration file: options

Home Location: /
```

does this Home Location seem normal to you?

thanks for helping out  :Exclamation: 

----------

## JPMRaptor

Based on what I've got in kgpg your options  should be:

  GnuPG Home:

    Configuration file:  gpg.conf

    Home location:       /home/karel/.gnupg/

----------

## k:arel

bingo!

i couldn't change the directory myself (the OK-button had no effect), but hitting the Defaults button set the address automatically for me

after all, it's obvious i haven't got any rights to create a temporary file in the root directory /

thanks a lot mate!

----------

