ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The problem is to create a user and assign a password for that user from the shell script instead of at prompt.
when i create a shell file
and i have typed
useradd xyz
passwd xyz pqr
and when i run the shell by giving bash file name, the new user is created but the password is not assigned, it is treating pqr is also a username
please tell me how to assign password for a user from the shell script
I tried same thing which you have mentioned, it doesnt show error at $prompt, when I try login with username(mtest) and when I enter the paswword in the password window. it is not allowing to login. but user is cerated without password,( I tried as root to assign, it that user(mtest )already exists).
I can't get 'useradd' to encrypt the password, whatever password you enter can be seen literally when you open '/etc/shadow'....This mean's that 'login' would encyrpt it, and the password would never be right, I guess this program just doesn't work as specified yet, mabey somebody should work on it.
Thanks Mr Tarts. It is working well.
U have done a great job to me. It is very much worth for me. I am in the mid of project . If any doubts can i contact u. pls give me ur mail id
Thank u very much
Originally posted by mtest Thanks Mr Tarts. It is working well.
U have done a great job to me. It is very much worth for me. I am in the mid of project . If any doubts can i contact u. pls give me ur mail id
Thank u very much
E-mail me from the link's at the bottom of my post, although, I don't know how much help i'll be.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.