Tuesday, 12 April 2016

How To Enable Direct SSH To EC2 Linux Instance Without Keypair File


To enable the direct ssh to linux EC2 instance without using keypair file we have to edit the sshd_config file.

Follow the given below steps

Step 1 : Login into linux EC2 instance with the help of keypair. Use the user name which is related to your instance. for eg

     example:

    ssh -i keypar_file.pem ubuntu@ec2-1.1.1.1.compute-1.amazonaws.com


Step 2: After login ,edit the /etc/ssh/sshd_config file and make the value of parameter called PasswordAuthentication as yes

    vi /etc/ssh/sshd_config

    change the PasswordAuthentication value as yes

    PasswordAuthentication yes

    :wq
    save and exit

Step 3: Restart the ssh service.

    In Debian or Ubuntu instance:

    /etc/init.d/ssh restart

    In CentOS or Red Hat instance:

    /etc/init.d/sshd restart

Step 4: Open new terminal in your PC or laptop. ( Do not take the risk :),playing safe side )

Now try direct ssh without using keypair file.

for eg.

    ssh ubuntu@ec2-1.1.1.1.compute-1.amazonaws.com

Done. :)



Ref:

http://sharadchhetri.com/2013/03/29/how-to-enable-direct-ssh-to-ec2-linux-instance-without-keypair-file/

No comments: