Thread View: ch.comp.os.linux
2 messages
2 total messages
Started by Eggenberger Marc
Fri, 29 Jan 1999 00:00
wie passwd aus pipe oder batch maessig aendern?
Author: Eggenberger Marc
Date: Fri, 29 Jan 1999 00:00
Date: Fri, 29 Jan 1999 00:00
14 lines
1048 bytes
1048 bytes
Hi ... gibts beim passwd ein parm mit dem ich aus einem script .. z.b. perl das passwort fuer user aendern kann .. man passwd hat nichts gezeigt .. und das normale pw ist ned so gut ... in nem batch muesste ich das pw einfach einmal eingeben koennen und gut ist ... -- mit freundlichen Gr�ssen ===================================== Eggenberger Marc me@ieo.ch Leimbachstr. 56 Tel 01/4802800 8041 Z�rich Fax 01/4802801 =====================================
Re: wie passwd aus pipe oder batch maessig aendern?
Author: Olivier M.
Date: Fri, 29 Jan 1999 00:00
Date: Fri, 29 Jan 1999 00:00
32 lines
1599 bytes
1599 bytes
<me@ieo.ch> ecrivait/schrieb/wrote:
>Hi ...
>
>gibts beim passwd ein parm mit dem ich aus einem script .. z.b. perl das
>passwort fuer user aendern kann .. man passwd hat nichts gezeigt .. und
>das normale pw ist ned so gut ... in nem batch muesste ich das pw einfach
>einmal eingeben koennen und gut ist ...
try something like this :
use Expect;
$Expect::Log_Stdout=0; # On by default.
($chpw = Expect->spawn("/usr/bin/passwd")) || &error("passwd pb 0 ?");
$chpw->expect(10, "ssword:") || &error("passwd problem ?\n");
print $chpw $password . "\n";
$chpw->expect(10, "ssword:") || &error("passwd problem2 ?\n");
print $chpw $newpass1 . "\n";
$chpw->expect(10, "ssword:") || &error("passwd problem3 ?\n");
print $chpw $newpass2 . "\n\n\n";
#$msg = $chpw->exp_before();
$chpw->soft_close();
Kann sicher schoener geschrieben werden, aber bei mir lauft es, also... :)
Olivier
--
____________________________________________________________
... Please replace "XW*SXD" by "olm" to answer by e-mail...
--- .-.. .. ...- .. . .-. -- ..- .-.. .-.. . .-.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads