[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Adduser Script
- Subject: Re: [cobalt-users] Adduser Script
- From: "Daniel Foster" <daniel@xxxxxxxx>
- Date: Thu Dec 7 03:38:00 2000
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> The problem is going to be getting them entered into the /etc/shadow
file
> with
> the encrypted password. So far the way to do this as I know is to go
to a
> command
> line and enter
>
> passwd username
>
> Then it prompts you to enter new password
> then prompts you to re-type password.
>
> How would one automate that process within this script you sent
> me so that it could take the password and enter these commands
> automatically?
You can specify the password on the adduser line. It says exactly how
in the man page, but I think its with the -p switch. The parameter
you give it has to be the encrypted from of the password, as generated
by crypt(). I'm no shell scripting guy, but a bit of Perl to do this
might be:
$cpass = crypt('password');
`adduser username -g 100 -c "User Fullname" -d
/home/sites/home/users/username -p $cpass`;
--
"With $10,000, we'd be millionaires!"
Homer Simpson
Daniel Foster - daniel@xxxxxxxx