6

I'd like to change the password of another user, as root, but don't want the user to be prompted to change their password when the log in. As far as I can tell, any mechanism to change the password as root set the ADMCHG flag in /etc/security/passwd

Ryan Emerle
  • 163
  • 1
  • 1
  • 5

4 Answers4

10
man pwdadm
pwdadm -c
Not Now
  • 3,532
  • 17
  • 18
6
  1. Use passwd to change the user's password: passwd $user

  2. Use pwdadm command to cancel the password-change prompt: pwdadm -c $user

That's it! :)

Brighid McDonnell
  • 379
  • 1
  • 7
  • 20
Vishal Ranjan
  • 61
  • 1
  • 1
2

echo "user:n3w_p466w0rd" | /bin/chpasswd -c

IOTAMAN
  • 665
  • 2
  • 8
  • 13
-1

Do you need to do it in an automated way? If it's a one-off then change it to a temp password, then login as that user and change it to the desired password.

pgs
  • 3,471
  • 18
  • 19