Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having trouble logging into my server via a password, even when I explicitly set the user's password via usermod. I've set PasswordAuthentication yes in my sshd_config and restarted the ssh daemon. I've even set the user's password multiple times. However when I try to login to my server, sshd shows the following log output:

Jan 24 21:18:31 ip-10-36-13-72 sshd[11756]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=  user=jimuser
Jan 24 21:18:34 ip-10-36-13-72 sshd[11756]: Failed password for jimuser from port 15508 ssh2

At this point I'm not really sure where to look. Any ideas?



auth       required pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth


# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so try_first_pass nullok
auth        required      pam_deny.so

account     required      pam_unix.so

password    requisite     pam_cracklib.so try_first_pass retry=3 type=
password    sufficient    pam_unix.so try_first_pass use_authtok nullok sha512 shadow
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
share|improve this question
@user2196728 What would I be looking for? –  Justin Meltzer Jan 25 '14 at 2:47
@user2196728 there you go :) –  Justin Meltzer Jan 25 '14 at 2:59
You set your password via usermod? You provided a hashed version of your password right? You should be setting a password with passwd username normally. –  Zoredache Jan 25 '14 at 3:57

1 Answer 1

up vote 0 down vote accepted

The first thing to do is to try setting the password for the user using the passwd command

# passwd jimuser
Changing password for user jimuser.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

If this works then all well and good but note that usermod takes a pre encrypted password string

-p, --password PASSWORD The encrypted password, as returned by crypt(3).

If you really do want to supply pre encrypted passwords then there are a variety of tools e.g. sha1pass (a perl script) grub-crypt (python) or take a look at the solutions here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.