• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to enable direct ssh to EC2 linux instance without keypair file

March 29, 2013 by Sharad Chhetri 8 Comments

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:

sudo systemctl restart ssh

In CentOS or Red Hat instance:

sudo systemctl restart sshd

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

That’s it. Now you can check.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to mount s3 bucket in linux EC2 instance
  2. How to set Name of EC2 instance by aws cli
  3. Non interactive ,without typing password do ssh to Server : By sshpass
  4. Add swap file in linux without reboot after OS installation
  5. Yum command to download rpm file without installing in linux system
  6. Be carefull while using phpinfo script in EC2 beanstalk
  7. Create and Remove AWS EC2 key pair by using command line
  8. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  9. Linux enable or disable multiple swap space
  10. vi : Edit file without opening it

Filed Under: AWS Tagged With: ec2, ssh

Reader Interactions

Comments

  1. mohan says

    October 31, 2017 at 9:45 am

    Thankq ,
    it’s working

    Reply
    • Sharad Chhetri says

      November 1, 2017 at 4:44 pm

      Welcome Mohan!

      Regards
      Sharad

      Reply
  2. Mastan Ali says

    June 3, 2016 at 4:39 pm

    Thank you for reply

    I am Oracle DBA exploring AWS cloud and the options available to migrate the on-premise database to Cloud .

    Not much in to Linux and Networking. Your advise will help.

    Thanks

    Reply
    • sharad chhetri says

      June 6, 2016 at 4:15 pm

      Hello Mastan,

      These action item require time and skills. Through commenting it is not possible to give each proper direction.
      We offer freelance work for such jobs, if possible contact to our team via email (admin@sharadchhetri.com) .

      Regards
      Sharad

      Reply
  3. Mastan Ali says

    June 3, 2016 at 11:18 am

    Hi ,

    i am new to AWS. So please ignore if its silly question

    i guess we need to have network connectivity between AWS Instance and on-premise server before we can attempt the above plan.

    Reply
    • sharad chhetri says

      June 3, 2016 at 3:54 pm

      Hello Mastan,

      Read about public and private ip address.It is must gain basic knowledge.
      In cut short, if AWS EC2 has public IP Address and your location ip is allowed in security group. You should be able to connect via ssh.

      Other than this you can connect via VPN, direct connect also.

      It seems you are fresher hence highly recommend to get more understanding on IP addressing, subnetting and routing at least.

      Regards
      Sharad

      Reply
  4. Tom says

    January 31, 2015 at 2:56 am

    THANK YOU

    Reply
    • sharad chhetri says

      January 31, 2015 at 3:57 am

      Welcome Tom,

      Regards
      Sharad

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Do not show line haveing particular keyword by grep command

Install and optimize the png file by using optipng

Protect from w00tw00t.at.blackhats.romanian.anti-sec

WordPress host IP changed not able to open wp-admin and site page looks scattered

configure: error: C++ compiler cannot create executables

How to forcefully send mail from mailq in sendmail MTA

Non interactive ,without typing password do ssh to Server : By sshpass

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy