Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi,
I want to add a user with its password without the need to prompt data like the password.
I've tried with this command:
useradd prometeo -d /home/prometeo -g test -m -p pippo
but the -p option ask for a password generated in the crypt-way. So I've tried passing the output of /usr/bin/mkpasswd pippo to useradd prometeo -d /home/prometeo -g test -m -p using a pipe and < but I can't find a way to make it work! Is it possible or does I need to use a script?
Someone have some suggestions?
Thanks
I've checked in the useradd man page but there is no --stdin. I'm using debian sid.
I've tried the command suggested, the user is added but passwd give an error:
passwd: opzione non valida -- -
usage: passwd [-f|-s] [name]
passwd [-x max] [-n min] [-w warn] [-i inact] name
passwd {-l|-u|-d|-S|-e} name
I've got the command:
useradd prometeo -d /home/prometeo -g test -m -p `mkpasswd pippo`
it works, no prompt, password is the word after mkpasswd :-)
thanks
'usermod' is used to change exisintg user's settings. It works just like 'useradd'.
regards,
...drkstr
**edit**
I'm not sure if your asking for help with the command, or the script. If the later, $1 is used to access a command line parameter in a shell script, $2 for the s2nd parameter ...etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.