From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Aulbert Subject: Re: Creating password for command on the fly Date: Fri, 16 May 2008 11:49:34 +0200 Message-ID: <482D58AE.1070800@welcomes-you.com> References: <91df29a20805160135l2d811216rcecf9aa1ad8eee4e@mail.gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <91df29a20805160135l2d811216rcecf9aa1ad8eee4e@mail.gmail.com> Sender: linux-admin-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: =?ISO-8859-1?Q?M=E1rio_Gamito?= Cc: linux-admin@vger.kernel.org M=E1rio Gamito wrote: > Hi, >=20 > I have this command to create an FTP account: >=20 > # pure-pw useradd mario -u 502 -g 502 -n 1000 -N 200 -d /home/pages/g= amito >=20 > This command asks for the password twice. >=20 > I need to pass the password (preferably without expect) so I can > create the account without prompting. >=20 > If i run: >=20 > # echo secret | pure-pw useradd mario -u 502 -g 502 -n 1000 -N 200 -d > /home/pages/gamito >=20 > It reads the first insertion, but asks for the second. Have you tried 'yes'? "yes PASSWORD" will output PASSWORD as many times as possible until STDIN is closed. Cheers Carsten -- To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html