0 votes
1 view
in AWS by (8.9k points)

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 pairs for clients to log in.

2: What's the easiest way to set up hosting sites/users in 1 AWS instance with different domains pointing to separate directories?

1 Answer

0 votes
by (18.5k points)

You can try the following steps:

Note: I did this for Ubuntu EC2

Step 1: Login as root using the keypair

Step 2: Set up the users and their passwords according to your requirements. You can use the following commands:

sudo adduser USERNAME

sudo passwd USERNAME

Step 3: Edit the SSH configuration, which you can do using /etc/ssh/sshd_config setting

Set the following parameters as given:

  •  For allowing a valid user to login without the key

PasswordAuthentication yes

  • If you want to allow root login without a key as well

PermitRootLogin yes

Step 4: Run the following command to restart the ssh daemon

sudo service ssh restart

Now you will be able to login to your ec2 without the keypairs.

For CenOS instance, follow the above-mntioned steps and replace ssh with sshd in the last step.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...