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

 

 

 

passwd: unrecognized option '--stdin' error on Debian

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
balasahu
Posts: 1
Joined: 2021-04-22 03:28

passwd: unrecognized option '--stdin' error on Debian

#1 Post by balasahu »

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

Re: passwd: unrecognized option '--stdin' error on Debian

#2 Post by arzgi »

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

Re: passwd: unrecognized option '--stdin' error on Debian

#3 Post by peter_irich »

For "-stdin" using you must use "openssl passwd", man openssl.
Don't do it, use ordinary /bin/passwd.

Peter.

Post Reply