SSH to AWS Instance without key pairs

后端 未结 6 1562
轻奢々
轻奢々 2020-12-04 06:45

1: Is there a way to log in to an AWS instance without using key pairs? I want to set up a couple of sites/users on a single instance. However, I don\'t want to give out key

6条回答
  •  天涯浪人
    2020-12-04 07:35

    Answer to Question 1

    Here's what I did on a Ubuntu EC2:

    A) Login as root using the keypairs

    B) Setup the necessary users and their passwords with

    # sudo adduser USERNAME
    # sudo passwd USERNAME
    

    C) Edit /etc/ssh/sshd_config setting

    For a valid user to login with no key

    PasswordAuthentication yes

    Also want root to login also with no key

    PermitRootLogin yes

    D) Restart the ssh daemon with

    # sudo service ssh restart
    

    just change ssh to sshd if you are using centOS

    Now you can login into your ec2 instance without key pairs.

提交回复
热议问题