I have set up a bastion public ec2 host and also setup a private ec2 which security inbound rule is set to ssh from only bastion security group. But, there is two different scenario. I have added both private key to ssh-agent and i'm trying this from windows machine with cmd.exe
When I try to access with this command below it can access without any probem-
ssh -J ubuntu@ip-public ubuntu@ip-private
When I access the bastion server first I can login successfully, but from bastion I try with this command but is failing-
ssh ubuntu@ip-private
channel 1: chan_shutdown_read: shutdown() failed for fd 7 [i0 o0]: Not a socket ubuntu@privateip: Permission denied (publickey).
I have tried multiple times but returning same error. Don't know how professionaly this bastion should setup. Looking for help and suggestions on this. Never tried before.