When connecting to SSH from Ubuntu in AWS practice, it took time to investigate various things to avoid the following error, so I wrote the command as a reminder. I struggled because I didn't know much about Linux commands.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
If Ubuntu doesn't have an SSH client, install it.
$ sudo apt-get install openssh-client
Move the key to the folder under the user name.
$mv key name.pem /home/User name/.ssh
$chmod 400 key name.pem
$ ssh -i key name.pem ec2-user@[IP address or DNS name]
In my case, I made a mistake in writing the user name ec2-user, or placed the key file in an appropriate location, and the error could not be resolved and I could not move forward easily. Please refer to those who are starting from now.