Answer the question
In order to leave comments, you need to log in
How can the Linux shell automatically answer a couple of questions?
When creating a user: $ adduser customuser
you need to answer a few questions:
Enter new UNIX password:
Retype new UNIX password:
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
printf "0000\r
0000\r
\r
\r
\r
\r
\r
y\r" | adduser customuser
Answer the question
In order to leave comments, you need to log in
Why not use another command and specify all the parameters from the beginning in the line?
https://www.opennet.ru/man.shtml?topic=useradd&cat...
pwgen 14 1 -B > /tmp/ps ; usermod -p $(mkpasswd -m sha-512 `cat /tmp/ps | tr -d '\r' | tr -d '\n'`) <username> ; cat /tmp/ps | mail -s "ВНИМАНИЕ! ВАШ ПАРОЛЬ!" кому@куда.ru ; rm /tmp/ps
Linux does not have cmd. There are all kinds of shells (shell), the most popular are bash, zsh, etc.
However, the question should still not be about them, but about the adduser command and you need to read the help for this command: man adduser
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question