-
-
Save woods/8970150 to your computer and use it in GitHub Desktop.
Key-Type: 1 | |
Key-Length: 2048 | |
Subkey-Type: 1 | |
Subkey-Length: 2048 | |
Name-Real: Root Superuser | |
Name-Email: [email protected] | |
Expire-Date: 0 |
# Generate the key | |
gpg --batch --gen-key gen-key-script |
Thanks that was really helpful
I got what I needed from : https://www.gnupg.org/documentation/manuals/gnupg-devel/Unattended-GPG-key-generation.html
without creating an actual file:
gpg --batch --gen-key <<EOF
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: [email protected]
Expire-Date: 0
EOF
I am getting the following error when running the script:
gpg: agent_genkey failed: No pinentry
gpg: key generation failed: No pinentry
@guillaume130679 https://www.google.com/search?q=gpg%3A+agent_genkey+failed%3A+No+pinentry
…
On Wed, Nov 11, 2020 at 7:07 AM Bluzz44 @.> wrote: @.* commented on this gist. ------------------------------ I am getting the following error when running the script: gpg: agent_genkey failed: No pinentry gpg: key generation failed: No pinentry — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://gist.github.com/8970150#gistcomment-3523891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAYDQ6S76KYB4LG66SCMLSPJ46NANCNFSM4S3ZFNJA .
This was more of an FYI note, I found how to resolve the issue https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html
Not sure what is different, but the code given on that page worked :)
Add %no-protection
if you need to generate passwordless keys. This also prevents the pinentry to pop up.
Using Process Substitution can be support indentation
gpg --full-gen-key --batch <(echo "Key-Type: 1"; \
echo "Key-Length: 4096"; \
echo "Subkey-Type: 1"; \
echo "Subkey-Length: 4096"; \
echo "Expire-Date: 0"; \
echo "Name-Real: Root Superuser"; \
echo "Name-Email: [email protected]"; \
echo "%no-protection"; )
Quick question for you, do you know if it's possible to use --batch
to create a master key and subsequent subkeys (3 to 4 at a time)?
I want to follow this guide: https://github.com/drduh/YubiKey-Guide and create a script that would create the master key and sub keys at the same time. After some research, I'm left with 'it can only generate 1 subkey' so I'm stuck right now
If you have an idea, could you share it?
I configured libvirt tu use /dev/urandom of the host: https://libvirt.org/formatdomain.html#elementsRng
That way keys generated within the VM should be ok.