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?