Cant connect to Linux instance in AWS using SSH client - amazon-web-services

I have downloaded the following private key from the AWS console to my C drive: cloud-labs-nv.pem
I am trying to run the following command to connect to my Linux instance through SSH client and i get the following error:
> ssh -i "cloud-labs-nv.pem" ec2-user#ec2-3-83-91-162.compute-1.amazonaws.com
ec2-user#ec2-3-83-91-162.compute-1.amazonaws.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Related

SSH connection to EC2 instance fails

I'm trying to create the SSH connection to EC2 instance but getting the error message that the keypair file does not exist.
AWS Management Console confirms that the keypair file exists:
Making connection to EC2 instance is fine but its seems that there aren't any files:
AWS Management Console confirms that the right command to set permissions is:
chmod 400 tauno537_aws_keypair.pem
When trying to execute this, it gives the following error message:
chmod: cannot access ‘tauno537_aws_keypair.pem’: No such file or directory
When trying to create the SSH connection to EC2 instance, it gives the following error message:
ssh ec2-user#x.xxx.xxx.xxx -i tauno537_aws_keypair.pem
Warning: Identity file tauno537_aws_keypair.pem not accessible: No such file or directory.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
What I have done wrong? Is it correct that when...
Making connection to EC2 instance (PuTTY login), the private key needs to be used?
Creating SSH connection, the public key needs to be used?
What's the diference between PuTTY login and SSH connection at all? Doesn't they both mean that making the connection to the EC2 instance?
Both your errors point to the fact that the private key file is not found in the directory where you're running from/pointing the private key to
Putty is just a SSH/Telnet client, so ultimately you are using a SSH connection. When a keypair is created, the private key remains clientside and the public key is uploaded to the server

Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on PowerShell

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

Trying to connect to RDS instance through my ec2 instance from my local machine and coming up with the following error

Tried connecting to the rds instance through the ec2 instance from and my local machine coming up with an error saying "Permission denied (public key)"
ssh -L 3306:db_instance_name.cxtitvmupc3w.us-west-2.rds.amazonaws.com:3306 my_instance_ip
Permission denied(public key)
This is ssh saying that you have not provided a private key to establish the ssh session.
You would normally include -i keyfile.pem in the command, exactly the same way you would normally ssh to the instance.

SSH connection in Amazon lightsail

I want to make an SSH connection from my own terminal, not from the browser-based command line interface Amazon provides. How do I know what username and host to use in my SSH command? So far, I'm unable to connect via SSH. I believe I am using the key correctly, but I am getting "permission denied (publickey)".
I have set 400 permissions for the private key file.
Can I use the public IP for the host? Is the username "ubuntu"? Something else?
Right now you can run only two base OS in LightSail:
Amazon Linux 2016.09.0
Default user: ec2-user
Ubuntu 16.04 LTS
Default user: ubuntu
The host name is the public IP, according to step #4 of the documentation at https://lightsail.aws.amazon.com/ls/docs/how-to/article/lightsail-how-to-set-up-putty-to-connect-using-ssh

AWS OpsWorks SSH Connect directly permission denied (publickey)

From AWS OpsWorks SSH instructions, connect directly section (ssh from Terminal):
Directly connect to the instance using your terminal application.
ssh://foobar#1.2.3.4
I just copied the ssh url and tried but got permission denied:
> ssh ssh://foobar#1.2.3.4
Permission denied (publickey).
Why?
Do not need to specify the protocol, just do:
ssh foobar#1.2.3.4