![]() |
passwd automatisieren
hi,
gibt es eine möglichkeit passwd zu automatisieren? ich möchte machen: habe eine datei wo user altes pw und neues pw drinnen steht. sepp hug0 neu max mimi neu franz lala neu und das ganze jetzt per sh script das file durcharbeiten lassen und das pw auf "neu" setzen. danke |
<insider>Na klar, ist ein perl Einzeiler (wirklich!). Frag einfach den Peter!</insider>
|
:p
|
müßte denk ich auch in einem shell skript gehen mit passwd befehl funktionieren, wobei du dann wahrscheinlich root rechte brauchen wirst um das pw der user zu änder n.
|
Re: passwd automatisieren
man usermod
|
Hi!
Für den Anfang, das auslesen einer CVS Datei ist nicht wirklich schwer. http://www.linuxforen.de/forums/show...22&postcount=5 Grüße Manx |
Kommt stark auf die Distro an, wie aufwendig das ist. `passwd` von Red Hat z. B: kennt "--stdin" als Option, wo du einfach auf stdin das Passwort eines Users hin-`echo`-en kannst. Hab ich sonst aber noch nirgendwo gesehen.
Das Problem ist eigentlich nur der Salt fuer den Hash des Passworts. Mit einem einfachen md5-Hashwert ist's naemlich nicht getan auf einem System mit PAM, und dieses "-p PASSWORD as returned by crypt()" ist auch nicht mehr ernstzunehmen ;) Weil wir grade dabei sind: Weisz jemand der Anwesenden, wie man an den jeweiligen Salt der Passwort-Hashes eines Systems kommt? |
http://www.digitalpeer.com/id/understanding
und "crypt(3) is the library function which is used to compute a password hash that can be used to store user account passwords while keeping them relatively secure. Technically the name is a misnomer since it is actually a cryptographic hash function. Traditionally it's been implemented using a simplified form of the DES algorithm. The user's password is truncated to eight characters, and those are coerced down to only 7-bits each; then a "salt" is randomly chosen and used to perturb these 56-bits into a DES key. That key is then used to "encrypt" a string of ASCII NUL characters, and the results are then encoded into a printable string (with the original "salt" also encoded and concatenated). When a user attempts to authenticate, the password they propose is run through the same function (with the same "salt" ... now decoded). If the results from this purported password match that which is stored in the system then the user is presumed to have used the same password." http://en.wikipedia.org/wiki/Crypt_(Unix) |
| Alle Zeitangaben in WEZ +2. Es ist jetzt 04:45 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag