The error message "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" usually means that the SSH client is unable to authenticate with the server using the provided key pair. Here are a few things you can try to fix the issue:
-
Make sure that the path to the key pair file is correct. Double-check that the file exists and that you have read permissions for it.
-
Check that the public key associated with the key pair has been added to the authorized_keys file on the server. You can do this by logging in to the AWS console, navigating to the instance, and checking the "SSH key pairs" section under "Security groups". Make sure that the public key associated with the key pair you're using is listed there.
-
Try specifying the username explicitly in the SSH command. For example, if the username on the server is "ec2-user", you would run:
ssh -i /_work/NSN/__ASW/FilamentBannersServerKeyPair.pem [email protected]
- If none of the above works, you can try connecting to the server using the AWS Systems Manager Session Manager. This allows you to connect to the server without using SSH keys. To do this, you'll need to install the SSM agent on the server and configure it to allow session connections. Once that's done, you can connect to the server using the AWS CLI:
aws ssm start-session --target instance-id
Replace "instance-id" with the ID of your AWS instance.
Regarding the "ERR_CONNECTION_REFUSED" error, this usually means that the server is not listening on the port you're trying to connect to. Make sure that the server is running and that the correct port is open in the security group. You can check this by logging in to the AWS console, navigating to the instance, and checking the "Security groups" section. Make sure that the port you're trying to connect to is listed there.