LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set password when creating user accounts (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-password-when-creating-user-accounts-526625/)

correro 02-08-2007 12:28 AM

How to set password when creating user accounts
 
I wish to specify password in plain text when using the useradd or adduser command. But the manual says the argument following -p should be an encrypted string.

How do I specify password in plain text when creating new user accounts?

This is needed when I create user accounts in a web application.

Thanks!

gilead 02-08-2007 12:37 AM

You could pass the password to the passwd command after creating the user account. If that's not practical, have a look at the man page for newusers, if it's installed on your system. It may let you do what you want since it can parse a file of username/clear text passwords.

correro 02-08-2007 12:50 AM

Thanks Gilead. No, newuser is not installed in my system.

If I pass password to passwd, would it require me to re-type the password?

But the whole process is supposed to be automatic. I created a web interface where username and password is entered, and this should call the system runtime and execute the useradd and related commands.

So how can I automate the process?

Thanks again!

gilead 02-08-2007 02:32 AM

I haven't tried it with the same sort of setup that you have, but a script using expect may be able to get the password and confirmation done for you.


All times are GMT -5. The time now is 07:35 PM.