Public bug reported:

Description:
Generating a gpg key unattended fails on Ubuntu 18.04.3 LTS.

Standard User 
> gpg --generate-key --batch < temp.batch
gpg: Generating a standard key
gpg: can't create '(null)': Permission denied
gpg: done

Root Superuser
#> gpg --generate-key --batch < temp.batch
gpg: Generating a standard key
gpg: agent_genkey failed: Inappropriate ioctl for device
gpg: key generation failed: Inappropriate ioctl for device
gpg: done


Steps to replicate:

> ~/.gnupg/gpg.conf
cert-digest-algo SHA256
digest-algo SHA256

# Generates batch instructions
cat > temp.batch << EOF
%echo Generating a standard key
Key-Type: RSA
Key-Length: 4096
Subkey-Length: 4096
Name-Real: temp
Name-Email: t...@contoso.com
Expire-Date: 0
%pubring temp.pub
%secring temp.key
# commit needed to echo
%commit
%echo done


#> gpg --version

gpg (GnuPG) 2.2.4
libgcrypt 1.8.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /root/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

** Affects: gnupg2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1846153

Title:
  gpg generate-key fails

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnupg2/+bug/1846153/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to