I am working with an embedded Linux system not related to any standard Linux distro like ubuntu or centos. The system utilizes many standard FOSS packages like systemd, busybox, shadow, etc.. The user accounts on the system are prompted to change the default login password upon the first login.

When the system does an upgrade of the file system, some information needs to be preserved. When I update the system, I want to preserve the login passwords, which is not a problem. But once the system is upgraded, the system determines the user accounts are the 'first login' and prompts the user to change the password. I want the system to retain the knowledge that the password has already been changed.

Is there a Linux configuration file with shadow or useradd that I need to retain and move during system upgrades to let the system know that this user has already logged in and reset the password?

Any info or feedback would be helpful. Cheers.

closed as unclear what you're asking by Romeo Ninov, Stephen Rauch, Rui F Ribeiro, GAD3R, Archemar Jul 25 '17 at 12:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • One way to figure this out would be to create an account, check which files have been changed (with find), log in, then check again. The files you seek should be in the second list, but not the first – Fox Jul 24 '17 at 19:55
  • Is this system using PAM or something else for the auth foo? – thrig Jul 24 '17 at 20:20

Without knowing more about the system ('not related to any standard Linux distro'), the most likely candidate will be the 'change password after' field in /etc/shadow.

Each line of this file contains 9 fields, separated by colons (“:”), in the following order:

  • login name
  • encrypted password
  • date of last password change
  • minimum password age
  • maximum password age
  • password warning period
  • password inactivity period
  • account expiration date

My hypothesis is that the values were not honoured when you created the accounts (again, you haven't specified how you've done that). The easiest way to avoid this is to use the 'chage' command to ensure that the accounts are not set to change password on first login (chage -E-1 $username and chage -I-1 $username).

For more information, man chage will give you more information on the parameters on your system.

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