0

I'm trying to create a new user (that can access email) with useradd. My command is

useradd --shell /bin/bash --create-home --password <password> <username>

However, I cannot login to email. When I use adduser to create an account, I can login to the mail just fine.

I am creating a home directory because my dovecot.conf has mail_location = mbox:~/mail:INBOX=/var/mail/%u

my mail.err file just has this repeated

Feb 21 15:52:46 server dovecot: auth-worker(3609): Error: pam(test,<myip>): 
pam_authenticate() failed: Authentication failure

How can I connect to the email (imap) with useradd? (or at least with one line)

1
  • 1
    What's OS and its version?
    – masegaloeh
    Feb 22, 2015 at 4:34

1 Answer 1

2

This error message:

Feb 21 15:52:46 server dovecot: auth-worker(3609): Error: pam(test,<myip>): pam_authenticate() failed: Authentication failure

can be caused by several reasons such as:

  • User didn't exist
  • Incorrect password

Based on above useradd command

useradd --shell /bin/bash --create-home --password <password> <username>

I suspect that you fall to the following mistake: useradd not encrypting passwords in /etc/shadow. Above command will put the plaintext password into /etc/shadow. And because PAM expects that /etc/shadow has encrypted password and yet you have plaintext password, the authentication will fail.

You must log in to answer this question.

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