Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see:
viewtopic.php?t=158230
New to Debian (Or Linux in general)? Ask your questions here!
balasahu
Posts: 1 Joined: 2021-04-22 03:28
#1
Post
by balasahu » 2021-04-22 03:36
I am using Debian. I am learning Bash scripting. I am creating a script that creates new user and sets password the problem is I get
Code: Select all
passwd: unrecognized option '--stdin'
error.
That is my script:
Code: Select all
#!/bin/bash
read -p "Please Enter Your Real Name: " REAL_NAME
read -p "Please Enter Your User Name: " USER_NAME
useradd -c "${COMMENT}" -m ${USER_NAME}
read -p "Please Enter Your Password: " PASSWORD
echo ${PASSWORD} | passwd --stdin ${USER_NAME}
passwd -e ${USER_NAME}
arzgi
Posts: 1193 Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times
#2
Post
by arzgi » 2021-04-22 13:03
Would you kindly show your script?
peter_irich
Posts: 1405 Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times
#3
Post
by peter_irich » 2021-04-22 17:27
For "-stdin" using you must use "openssl passwd", man openssl.
Don't do it, use ordinary /bin/passwd.
Peter.