I am trying to connect an AWS CentOS instance from an AWS Windows instance using PowerShell of the Windows instance. But I am getting the error "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" I am able to connect to the centos instance from my own windows PC using PuttY. I just don't have a Windows 10 in my PC to test with Powershell, So I created a Windows 10 instance in AWS and trying to connect through its Powershell, but in vain. I copied the private key (.pem) file from my own PC, pasted in the desktop of the Windows instance accessed through RDP and put the ssh command, but not able to connect.
Also, the security group of the linux instance has 3 Inbound rules, Allow Any IP from SSH/Port 22, HTTP/Port 80 and Any Traffic, Any IP/All Ports.(IP : 0.0.0.0/00) Please point where i am going wrong.Thanks.
The ssh command I used :
ssh -i C:\Users\Administrator\Desktop\cent.pem centos@mydomain.compute.amazonaws.com