![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/local/bin/expect --
set user [lindex $argv 0]
set newpass [lindex $argv 1]
spawn passwd $user
expect "assword:" {
send "$newpass\r"
}
expect "gain:" {
send "$newpass\r"
}
expect eof
Quotebash-3.00# /usr/local/bin/expect
expect1.1> spawn passwd test
spawn passwd test
19152
expect1.2> expect word:
Changing password for "test"
test's New password: expect1.3> send bla
QuoteEvtl. kann man ja upgraden?ich würds ja mit useradd -p passwort machen, aber der -p switch wird bei meinem system nicht unterstützt, ebenso wenig usermod
1
2
3
4
5
6
7
8
9
#!/usr/local/bin/expect -f
#Usage: chpassword user newpassword
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof
QuoteTut mir leid :(Naja nicht wirklich,
Quotebash-3.00# ./npasswd test bla
spawn passwd test
Changing password for "test"
test's New password:
Enter the new password again:
Quotebash-3.00# ./addsqluser
spawn /opt/freeware/mysql/bin/mysqladmin -u root -p status
Enter password:
Uptime: 31390 Threads: 1 Questions: 6 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.000
Killed by signal 15. < ssh session auf der firewall gekilled
[root@doorgunner admin]#
![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |