LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with /etc/passwd and /etc/passwd- files (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-etc-passwd-and-etc-passwd-files-856427/)

linuxravindra414 01-14-2011 10:24 PM

Problem with /etc/passwd and /etc/passwd- files
 
hi all..
we know that /etc/passwd - is a replica of /etc/passwd file and acts as a backup in any damage done to /etc/passwd file..
i have observed a strange thing in RHEL 5.4....
for example... if /etc/passwd has 100 accounts.. then /etc/passwd - is having only 99 accounts....
when i add 101 useraccount with "useradd" then /etc/passwd has 101 accounts and /etc/passwd is having the 100th account of /etc/passwd - ..
when i delete /etc/passwd and recover it with /etc/passwd - from runlevel 1 the lastly created user is not having his account after recovery.. what is the solution?
this is same case even with /etc/shadow and /etc/shadow -
thanks in advance...

druuna 01-15-2011 04:46 AM

Hi,

The dash files (passwd-, shadow-, gshadow- and group-) are backups of the previous version, not the current version. I.e.: If you add a user (or make some other change) the original (without the changes) is saved as a dash file.

Hope this helps.

unSpawn 01-15-2011 05:17 AM

Quote:

Originally Posted by linuxravindra414 (Post 4224845)
what is the solution?

Make copies of both the file itself and its backup file.


All times are GMT -5. The time now is 10:57 AM.