Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am running Redhat Linux 7.0 with over 30 users set-up. I current backup all personal files and system files that I need to be able to restore the server if it fails. But I am unsure if I will be able to restore all user names and passwords without re-entering them all.
Please can some one tell me how I can make sure that I will be able to restore all user information if I need to?
As far as I know, all information needed to specify the users available on the system is saved in /etc/passwd, along with /etc/shadow if you have shadow passwords enabled. Group information is saved in /etc/groups.
All these files are plain ASCII text, so I presume you could just make backups of these, and restore them later if something bad happens (actually, backing up the entire /etc/ directory wouldn't be a bad idea, since it contains config stuff for everything else too).
Though, I have not experimented much with backups... perhaps there is a better system for doing this.
By the way, nobody's password is actually saved anywhere. /etc/passwd (or /etc/shadow, if shadow is on) simply contains a string of garbage known as a hash. When you enter your password, it gets hashed into garbage in a particular way. If the garbage matches the garbage in /etc/passwd, you get to log in. The hash function is one-way, meaning you can't figure out what someone's password is from the hash (without a ridiculous amount of brute-force guessing). Just a tidbit of info if you are interested
Nice to hear someone actually doing critical backups ;-) Note that the brute force needed to break passwords is not so significant these days with the current speed of computers. It is one reason shadow passwords are typically (and should be) used. One more layer of protection by only allowing root access to the hashed passwords.
Originally posted by fsbooks Note that the brute force needed to break passwords is not so significant these days with the current speed of computers. It is one reason shadow passwords are typically (and should be) used.
Quite true. They use DES, I think...? Brute-forcing regular DES is quite feasible these days, especially with a hardware DES cracker. (The EFF built a hardware cracker for $250,000 which cracked one key in 3 days, and the distributed project did it in 22 hours).
Triple-DES is supposedly good enough to be unbreakable, though quantum computing may prove that wrong...
So yes, shadow passwords are an extremely good idea
Distribution: Debian Lenny, Debian Squeeze, CentOS 5.6, CentOS 6.0, Mac OS X 10.5.6
Posts: 158
Rep:
i've tried restoring the /etc/passwd on a system that crashed. i had to re-enter all users. when i tried to login, the passwords didn't work. why? i found out that the GUID and UID's didn't match what was in the password file. this was on a rh7.3 system. i also read somewhere that the passwd encryption algorithym is machine specific; meaning that you can't use the passwd file on a different system because of how the passwd's are hashed in a text file.
this has been my own experience and what i have read. if i am incorrect with any information that i have posted, please, someone let me know.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.