usermod -p hogyan

Fórumok

Hali!

sudo usermod -p akarmi user miert nem mukodik? A parancs lefut rendesen, csak nem tudok utana bejelentkezni a user-rel.
A /etc/shadow fileba encrypt nelkul irja be a jelszot.

THX.

Hozzászólások

-p, --password PASSWORD
The ***encrypted*** password, as returned by crypt(3).

google elso talalata "usermod -p" -re:

---

To assign an initial password, use the following steps:

*

Start the command line Python interpreter with the python command. It displays the following:

Python 2.2.2 (#1, Dec 10 2002, 09:57:09)
[GCC 3.2.1 20021207 (Red Hat Linux 8.0 3.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

*

At the prompt, type the following (replacing password with the password to encrypt and salt with a combination of exactly 2 upper or lower case alphabetic characters, digits, the dot (.) character, or the slash (/) character such as ab or 12:

import crypt; print crypt.crypt("password","salt")

The output is the encrypted password similar to 12CsGd8FRcMSM.
*

Type [Ctrl]-[D] to exit the Python interpreter.
*

Cut and paste the exact encrypted password output, without a leading or trailing blank spaces, into the following command:

usermod -p "encrypted-password" username

Ehez hasonlo megoldasokat talatam en is a neten, de nekem az kellene, hogy van jelszo generalo binarisom, es ennek a kimenetet szerettem volna extra programozasi nyelv, felhasznaloi beavatkozas nelkul atadni a usermod-nak. A passwd/expect-el sikerult. Gondoltam, hogy a usrmod-dal egyszerubben megoldhato, ha nem maradok ennel a valtozatnal.