Not able to clear.
steps performed:
on aws-client-
ssh-keygen -t rsa -b 2048 -f ~/.ssh/devops-ec2
on ec2 instance
echo “devops-ec2.pub key contents” | sudo tee /root/.ssh/authorized_keys
sudo chmod 700 /root/.ssh/authorized_keys
on aws-client
ssh -i ~/.ssh/devops-ec2 root@public_ip_address
edited the /etc/ssh_config
PermitRootLogin yes
PasswordAuthentication no
Did you literally type “public_ip_address”, or did you substitute the IP address from the ec2 instance’s info page in the console? Also, chmod 700 is wrong for the key file; you should do something more like chmod 400, since you want the authorized key file to be read-only.
no, i mentioned the IP address from the ec2 instance’s info page in the console
Ok i will try with chmod 400
I have created a new ssh key on aws client and copied the key to ec2 instance ssh dir using instance connect
I am able to ssh to the ec2 using aws client but still failed
Have you cleared yet or not?
not yet cleared. do i need to edit the ssh_config file also ?