From: Jamie C. <jca...@we...> - 2002-09-01 00:59:01
|
docv wrote: > > > Freddie Cash wrote: > >> >> If you want the user to be able to type a username and a password, >> click a button and have the account created, then yes this is >> possible. You just need to create multiple variables. Set the type >> of one of those variables to "password" and it will look/act just like >> a variable of type "text" except any input displays as ******. >> >> So, your command would be: /path/to/script.sh $username $password >> >> In the first text box at the bottom of the screen you'd type username, >> and in the one below it you'd type password, and change the input type >> to password for that entry. >> >> If you need more than 2 variables, you need to save the command, then >> edit it. Then save it, then edit it (and so on, for each new variable >> you wish to add to the command). >> > Yup, got all that, however when passwd is run, it asks for the password > 2x (to insure no typos occurred). Would that part of my script need to > be written as follows; > > passwd $1 < $2 Feeding the password to the passwd command like that will not work though, because it always tries to get input from the terminal, not standard input. Webmin has to do some tricky stuff involving creating new ttys to run the passwd command when using it to change passwords, in order to get around this problem. - Jamie |