Image - /etc/group-, /etc/passwd-, & /etc/shadow-

What are these files, and should I include them in the make image process?

/etc/group-
/etc/passwd-
/etc/shadow-

BACKGROUND

My router is a TP-link C7 v5 running on an OpenWrt release 19.07.8 custom image.

I keep track of config files that changed and therefore should be included in the make image process (through the FILES=files/ segment).

To find out what changed, I keep a running roster of what I hand-edit and also run a "before and after" (meld) comparison of the router's /etc contents.

After a hand-edit session in which I added a non-root user and made it superuser, I ran a comparison and got the following as "changed":

/etc/group
/etc/passwd
/etc/shadow
/etc/sudoers

As they are just the configs involved in the hand-edits, no surprise.

The comparison however yielded these files as "new":

/etc/group-
/etc/passwd-
/etc/shadow-

Inspection shows that each *- and * pair (e.g. passwd- and passwd) are related as follows:

  • *- has an earlier last modification time than * (by a few minutes).
  • *- and * are exactly the same contents (from loading them in nano).

My thoughts: That *- is a few minutes older suggests it being a backup file, but two having same contents contradicts that.

Hence my questions:

  • What are the *- files for?
  • Should I include them in the make image process or leave them out (as something temporary)? Thanks.
1 Like
2 Likes

Thanks!

I guess the implication of their status as backup is that I don't include them in the image making.

But what good is a backup that is indistinguishable from the current version in contents? If only one pair were indistinguishable, I might have thought I made a mistake and re-saved, but all three?

1 Like

The related tools are not smart enough to check for actual configuration changes.
They just back up the respective files on each successful command invocation.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.