Score:0

trying to generate ssh keys of the vm but getting the error option requires an argument -- P

in flag

I have executed the below command manually in the vm and i am able to generate the ssh keys but when i tried using the same script in the automation pipeline from github actions i am getting the error

Script: name: Azure CLI script

           uses: azure/CLI@v1

           with:

           inlineScript: |
    
            az vm run-command invoke --command-id RunShellScript -g "${{ env.RESOURCEGROUPNAME }}" -n "${{ env.VM_NAME }}"  --scripts "chmod 700 /home/adminuser/.ssh && ssh-keygen -t rsa -f /home/adminuser/.ssh/id_rsa -P """

error: \n[stdout]\n\n[stderr]\noption requires an argument -- P\r\nusage: ssh-keygen [-q] [-b bits] [-C comment] [-f output_keyfile] [-m format]\n [-t dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa]\n [-N new_passphrase] [-O option] [-w provider]\n ssh-keygen -p [-f keyfile] [-m format] [-N new_passphrase]\n [-P old_passphrase]\n ssh-keygen -i [-f input_keyfile] [-m key_format]\n ssh-keygen -e [-f input_keyfile] [-m key_format]\n

Score:0
ge flag

May be use single quote instead of double. Or Vise Versa for the Password field.

'chmod 700 /home/adminuser/.ssh && ssh-keygen -t rsa -f /home/adminuser/.ssh/id_rsa -P "" '

or

"chmod 700 /home/adminuser/.ssh && ssh-keygen -t rsa -f /home/adminuser/.ssh/id_rsa -P '' "

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.