0

I have a very simple question, I have created an instance with aws AMI. I can log into it using my key. But I want to login using a username and password.

useradd username -p password

This has created the user and password, but when I try to login I get

ssh [email protected]
Permission denied (publickey).

I am on redhat

cat /etc/*release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03

I did some reading and learnt it must be something to do with pam but I failed adding/removing anything.

1 Answer 1

0

Try this:

Modify /etc/sshd_config and set the PasswordAuthentication setting to yes.

Then restart sshd: /etc/init.d/sshd restart.

You'll either need to sudo to root, or use sudo to run these commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .