SSH connection for local user

sorry for the delay, below is the output:
image

Let me see if I understand this correctly.

You want to directly SSH as user test1 onto the EC2 instance?

User looks to be properly created.
Have you generated SSH keys for this new user? The keys from the key pair associated with the instance are only valid for the ec2-user login. It does not apply to any other users you may create on the instance

On a practical scenario, when we create any local user for application team, we dont give any keys to them. We just share their username and password. That’s what I am trying to do here.

In a practical scenario, it is more secure to use SSH keys for login rather than issuing username and password. The workflow goes like this

  1. Agreement to create account. Admin creates account on server.
  2. User creates a keypair using ssh-keygen. This utility is also present on Windows.
  3. User sends public key of key pair to Admin. Can be by email, this is fine!
  4. Admin adds this key to .ssh/authorized_keys file in new user’s home directory
  5. User logs in with ssh -i private-key-file user@server

This way no private information (like a password) needs to change hands, only a public key which is public knowledge so the transaction of creating and enabling the user account is secured.