Re: adduser without ncurses?
From: Martin P. Hellwig (mhellwig_at_xs4all.nl)
Date: 06/19/04
- Previous message: Richard T. Kus: "Re: adduser without ncurses?"
- In reply to: Erica: "Re: adduser without ncurses?"
- Next in thread: Martin P. Hellwig: "Re: adduser without ncurses?"
- Reply: Martin P. Hellwig: "Re: adduser without ncurses?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 19 Jun 2004 20:31:14 +0200
Erica wrote:
> jpd <read_the_sig@do.not.spam.it> wrote in message news:<1087627046.804891@ente.ipberlin.com>...
>
>>["Followup-To:" header set to comp.unix.bsd.freebsd.misc.]
>>On 2004-06-19, Erica <erica@technodyke.com> wrote:
>>
>>>I wrote a script to add a whole bunch of users to a FreeBSD box using
>>>input from
>>>a file. However, I need something that works like adduser or useradd
>>>without ncurses, that is, without prompting for input.
>>
>>adduser does not use curses but does prompt for input.
>>
>>What about pw(1)?
>
>
> pw works, except that it doesn't allow me to set a password. passwd
> sets the password, but it prompts for input. Any suggestions?
I know that the pw command is quite complicated but when I do the
following on my box:
% pw useradd -n test -d /home/test -m -s /usr/local/bin/bash -w random
then I get on my stdout:
password for 'test' is: Ugym8gbxcV
But if you like to use prefab passwords, you can do that by storing the
password in a textfile and using redirectors:
% pw useradd -n test -d /home/test -m -s /usr/local/bin/bash -h fd <
passwd4usr_test.txt
If you dont use the redirector you get (single) prompt for a password.
It is quite scriptible IMHO, reading man pw is recommend however.
--
mph
$ /usr/local/etc/rc.d/bikeshed.sh
$ Usage, mix UNIX with: {politics|religion|both(=GNU/Linux)}
- Previous message: Richard T. Kus: "Re: adduser without ncurses?"
- In reply to: Erica: "Re: adduser without ncurses?"
- Next in thread: Martin P. Hellwig: "Re: adduser without ncurses?"
- Reply: Martin P. Hellwig: "Re: adduser without ncurses?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|