Re: adduser without ncurses?
From: Martin P. Hellwig (mhellwig_at_xs4all.nl)
Date: 06/19/04
- Next message: jpd: "Re: adduser without ncurses?"
- Previous message: Martin P. Hellwig: "Re: adduser without ncurses?"
- In reply to: Martin P. Hellwig: "Re: adduser without ncurses?"
- Next in thread: jpd: "Re: adduser without ncurses?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 19 Jun 2004 21:08:00 +0200
Martin P. Hellwig wrote:
> 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
BTW
To add a user directly from the command prompt without using a
passwordfile or being prompt for password but using a predefined
password use something like this:
% echo "thisisthepass4test" | pw useradd -n test -d /home/test -m -s
/usr/local/bin/bash -h fd
--
mph
$ /usr/local/etc/rc.d/bikeshed.sh
$ Usage, mix UNIX with: {politics|religion|both(=GNU/Linux)}
- Next message: jpd: "Re: adduser without ncurses?"
- Previous message: Martin P. Hellwig: "Re: adduser without ncurses?"
- In reply to: Martin P. Hellwig: "Re: adduser without ncurses?"
- Next in thread: jpd: "Re: adduser without ncurses?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|