-3

First ever question for me. Straight to the point. I've added a user:

sudo useradd -m _homedir_ _username_

Tried all of these but nothing worked:

passwd _username_

chpasswd username: _password_

usermod -p _password_ _username_

I'm still unable to login directly but login works fine using

su -l username

Via root login. This is the entry on the /etc/passwd file

sftp_raes:x:11114:500:SFTP trasnfer ad-hoc user:/apps/data:/bin/bash

PS. Passwd seems not to detect digits, always prompting 'less then 1 digit error error using passwd - digits undetected

  • "digits" refers to a number (i.e. 0-9). Are you sure you're entering at least one number (and not using the numpad)? – Kevin Kruse Jul 20 '18 at 15:15
4

Edit: The original Question and title are answered in the original Answer below. The updated Question contains the correct command and is answered here in the updated Answer.

Updated Answer

A digit is a number (i.e. 0-9). The password contains less than [n] digits means your password requirements require at least n digits.

Original Answer

To change the password for another user, run this as a root user:

passwd myusername

Then you're prompted to input the password. See man passwd on your system, or use the following link online.

  • or better, man passwd on your RHEL system (as the OP is using RHEL) – Jeff Schaller Jul 19 '18 at 18:58
  • @JeffSchaller yes, I still haven't settled on a preferred method of saying "use man, or use this link". I chose a link whose manpage matches my manpage (CentOS). Will try to edit the answer a bit. – Kevin Kruse Jul 19 '18 at 19:06
  • 1
    Indeed, it's been a discussion for a couple years – Jeff Schaller Jul 19 '18 at 19:07
  • Thanks @KevinKruse but all commands I listed in the post were performed as root. Passwd in particular is giving me 'less then One digit error' due to the undetected digits while trying to set password – user3405492 Jul 19 '18 at 20:56
  • @user3405492 your post indicates you used passwd mypassword, not passwd myusername. After that, you will be prompted for a password but the characters will not be displayed on the terminal. If you are still having issues, please show what displays on the terminal after you use passwd myusername – Kevin Kruse Jul 19 '18 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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