Summarizing from the discussion (above). @Gabor152, Thanks for sharing the info/solution with the community.
Issue: How to forward agent with "az ssh arc"
Solution: Steps to make it work:
-
az ssh config --resource-group ${RG} --name host1 --file ssh_config
- Rename
id_rsa.pub-aadcert.pub
toid_rsa-cert.pub
(check paths in ssh_config file) -
ssh-add id_rsa
- it says "Identity added:...", "Certificate added:..." -
ssh-add -L
shows the certificate -
az ssh arc --resource-group ${RG} --name host1 -- -A
- from host1:
ssh host2
- works, without any further configuration.
Background: If the identity file is say XYZ, then the SSH client will look for the certificate in XYZ-cert.pub.
Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, I' have summarized and posted the solution/answer to benefit the community users to find the answers quickly.
If the response helped, do "Accept Answer" and up-vote it