0

In the Web SSH console for my Azure Linux host, the following command:

gpg --homedir=$homeDir --batch --gen-key pgp-params.txt

results in this:

gpg: error running '/usr/bin/gpg-agent': exit status 2
gpg: failed to start agent '/usr/bin/gpg-agent': General error
gpg: can't connect to the agent: General error
gpg: agent_genkey failed: No agent running
gpg: key generation failed: No agent running

Running the same command in the Kudu Bash console

gpg --homedir=$homeDir --batch --gen-key pgp-params.txt

results in this:

gpg: can't connect to the agent: IPC connect call failed
gpg: agent_genkey failed: No agent running
gpg: key generation failed: No agent running

Either way, the following two files are generated, but nothing else:

private-keys-v1.d
pubring.kbx

What am I missing in order to successfully generate keys in this environment?

(Ultimately, I want to have my Azure Function App generate keys--I was running into problems which lead me to stepping through this in the various consoles)

Donny Kwitty
  • 327
  • 2
  • 15

1 Answers1

0

I tried to SSH into my Function App ran below commands and got the same error code as yours :-

apt install gnupg

enter image description here

gpg --gen-key

enter image description here

To resolve this error, I ran below commands and tried creating gpg keys :-

apt-get install -y gnupg gnupg1
cp -a /usr/bin/gpg /usr/bin/gpg2
ln -sf /usr/bin/gpg1 /usr/bin/gpg
gpg --gen-key

Results:-

enter image description here

And the Keys were generated successfully like below :-

enter image description here

Reference :-
gpg: can't connect to the agent: IPC connect call failed By Paxsali

SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11
  • looks promising, but attempting this with the --batch option seems to be causing an "invalid usage list" error. ????? – Donny Kwitty Jan 12 '23 at 20:36