Not able to ssh to aws ec2 instance using config and doing key less ssh

Tags:

Answer: 1

11 hours ago

My config file is located at /home/vidur/.ssh/config and its content is:

Host ec2
     HostName 54.69.86.125 
     User ubuntu
     Identity /home/vidur/Documents/SSH_PEM_FILES/tukacloud.pem

Host *
  AddKeysToAgent yes
  IgnoreUnknown UseKeychain
  UseKeychain yes

When I run:

ssh ec2

Gives the following error:

home/vidur/.ssh/config: line 4: Bad configuration option: identity
/home/vidur/.ssh/config: terminating, 1 bad configuration options

Can you please guide me for the correct configuration I am using Ubuntu 20 both in local Ubuntu and remote AWS machine.

However, simple SSH with key present in the command will work.

ssh -i tukacloud.pem ubuntu@ec2-54-69-86-125.us-west-2.compute.amazonaws.com
Added by: Jack Haley

Answer: 2

5 hours ago

Host ec2
    HostName 54.69.86.125
    User ubuntu
    IdentityFile /home/vidur/Documents/SSH_PEM_FILES/tukacloud.pem

Host *
  AddKeysToAgent yes
  IgnoreUnknown UseKeychain
  UseKeychain yes
Added by: Orval Johnson

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9