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! |
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.
|
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! |
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. |