using cmd from windows, and ssh to comnect to the VM instance created returns:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
and process exits
Are you specifying the private key in your
ssh command? You need to use something like:
ssh -i private-key.pem email@example.com
private-key.pem should be the filename of the private key for the server you’re connecting to.
ssh man page at https://linux.die.net/man/1/ssh
On windows, you probably want to use putty to connect. You can also use Mobaxterm or similar softwares
Because you must use:
ssh -i Your.pem DefaultUserName@YourPublicServerIP
For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
Verify if you are using ec2-user how your default user
For others OS
Ubuntu AMI, the user name is ubunt. CentOS AMI, the user name is centos. Debian AMI, the user name is admin. Fedora AMI, the user name is ec2-user or fedora. SUSE AMI, the user name is ec2-user or root. RHEL AMI, the user name is ec2-user or root.