AWS OpsWorks SSH Connect directly permission denied (publickey) - amazon-web-services

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

Related

Cant connect to Linux instance in AWS using SSH client

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).

Permission Denied (Public Key) EC2

I'd like to ask you for assistance on this. It is the first time I'm trying
to ssh into EC2 instance from my laptop. I've got pem file with permission bits set to 400 in ~/.ssh
The instance is up and running and my attempt is:
ssh -i ~/.ssh/app-prod.pem coding_hedgehog#ec2-1-7-6-51.eu-west-2.compute.amazonaws.com
output:
coding_hedgehog#ec2-1-7-6-51.eu-west-2.compute.amazonaws.com: Permission denied (publickey)
I'm following this article but nothing seems to work in my case. coding_hedgehog is my IAM and it is displayed when I'm logged into AWS console so the problem can't be using wrong IAM nick.
The EC2 instance runs Ubuntu 20.04
Some tutorials show that using ubuntu#public_dns will work. I get the same error though.
Security Group inbound rules:
Instructions to connect via ssh:

Unable to access instance Permission denied (publickey) after installing vsftpd

I am unable to access my ec2 ssh , the last thing i am sure that i've did is created AMI in aws console and then installed vsftpd:-
sudo apt install vsftpd
That's it.
Now when i am trying to access ec2 ssh i get the following error:-
ssh -i sshkey.pem ubuntu#ec2-00-000-000-000.eu-west-3.compute.amazonaws.com
ubuntu#ec2-00-000-000-000.eu-west-3.compute.amazonaws.com: Permission denied (publickey).
How can i fix this?
Installing vsftpd can never have an impact on your SSH access.
the only things I think of:
you regenerated ssh keys for ubuntu user.
you rebooted your ec2 server and with elatic IP attached and now it has a different IP.
your ssh key has wrong permissions, it should be 600

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.

AWS ssh into instance giving Permission denied (publicly)

I am trying to ssh into a new EC2 instance. I have followed the instructions and when I attempt to ssh I get Permission denied (publickey).
Below is an image of everything I did in the console according to the instructions. Everything seems to go accordingly until I enter yes. Then it fails. I have followed the instructions twice and get the same result. I also do not have AWS CLI Tools as I believe they are optional.
ssh will use your local username to connect to the instance by default, if you not specified Host, User and IdentityFile in your ~/.ssh/config.
As you call ssh to your instance with the pem specified on the command line you also have to specify the remote user name (which is ec2-user for AWS linux instances and ubuntu for AWS Ubuntu instances).
Try to use this commandline:
ssh -i sub_api.pem ec2-user#ec2-54....