HI@all,
gibt es eine möglichkeit das passwort eines user per konsole zu ändern?
So wie man z.b. auch einen user mit useradd ... anlegen kann.
greetings
verve
Druckbare Version
HI@all,
gibt es eine möglichkeit das passwort eines user per konsole zu ändern?
So wie man z.b. auch einen user mit useradd ... anlegen kann.
greetings
verve
"passwd user"
Also root das PW von einem User ändern > passwd Username
Als User sein eigenes PW ändern > passwd
Gruß
mal wieder zu langsam...
danke für eure antworten
ist es auch irgendwie möglich, den befehl in eine zeile zu bekommen?
also das er nicht extra fragt: new passwort etc..
irgendwie passwd user passwort
oder so, unter passwd --help könnte ich soetwas nicht entdecken
man passwd und passwd --help erwähnen die Option --stdin, durch die das Passwort von der Standardeingabe gelesen wird:Zitat:
Zitat von verve
Code:echo 'passwort' | passwd --stdin username
hi!
danke für deinen tipp ... allerdings gibt es diese option bei mir nicht! (habe SuSE Linux 8.1)
Bei mir sieht das so aus:
geht das vielleicht trotzdem irgendwie ?Code:linux:/srv/www # passwd --help
Usage: passwd [-f|-g|-s|-k[-q]] [name]
passwd [-n min] [-x max] [-w warn] [-i inact] user passwd {-l|-u|-d|-S[-a]|-e|-h} user
passwd - change password information
-f Change the finger (gecos) information
-h Change the home directory
-s Change the login shell
-g Change the group password
-k Change the password only if expired
-q Try to be quiet
-S Show the password attributes
-a Only with -S, show for all accounts
-d Delete the password for the named account
-l Locks the password entry for "user"
-u Try to unlock the password entry for "user"
-e Force the user to change password at next login
-n min Set minimum field for "user"
-x max Set maximum field for "user"
-w warn Set warn field for "user"
-r service Use nameservice 'service'
--help Give this help list
--usage Give a short usage message
--version Print program version
Valid services for -r are: files, nis, nisplus, ldap
nimm expect
hi!,
was meinst du damit?Zitat:
Zitat von Blackhawk
expect als befehl gibt es nicht und in verbindung mit passwd kann ich es leider auch nicht bringen.
Zitat:
expect als befehl gibt es nicht und in verbindung mit passwd kann ich es leider auch nicht bringen.
Installiert sein muss es aber schon. ;o)Code:EXPECT(1) EXPECT(1)
NAME
expect - programmed dialogue with interactive
programs, Version 5
Code:user=$1
password=$2
crypt=`mkpasswd --hash=md5 $password`
usermod -p $crypt -U $user
Was voraussetzt, dass das Password per md5 verschlüsselt wird, was aber soweit ich weiß nicht bei allen distris der Fall ist.Zitat:
Zitat von Svenny
naja, man kann auch andere types nehmen.