Re: Creating password for command on the fly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Mário Gamito wrote:
> Hi,
> 
> I have this command to create an FTP account:
> 
> # pure-pw useradd mario -u 502 -g 502 -n 1000 -N 200 -d /home/pages/gamito
> 
> This command asks for the password twice.
> 
> I need to pass the password (preferably without expect) so I can
> create the account without prompting.
> 
> If i run:
> 
> # echo secret | pure-pw useradd mario -u 502 -g 502 -n 1000 -N 200 -d
> /home/pages/gamito
> 
> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux