[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Adduser Script
- Subject: Re: [cobalt-users] Adduser Script
- From: "Randy" <rherban@xxxxxxxxxxx>
- Date: Wed Dec 6 09:33:00 2000
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> I have been playing around on our spare RAQ2 server with the adduser
> command.
>
> It is really quit simple once I figured it out to add a user.
>
> adduser username -g 100 -c "User Fullname" -d
> /home/sites/home/users/username
>
> This add's them to the home group -g 100 and creates home directory and
> default shell.
>
> Then I run passwd username
> and enter password twice and they are all set.
>
> Of course this does not add them to web interface but I am finding in this
> case that I wont
> be able to use the interface for what I need anyways as I am about to add
> 700 accounts
> and cobalt pretty much has said not to do it and I am not sure how I can
> anyways since
> it takes as long as 2 - 5 minutes via the web interface to add a single
> account now and I
> have only added about 250 users.
>
creating the script to add the accounts is fairly easy, assuming you know
perl
as for getting them into the siteadmin list, there is a command for the raq2
to recreate the siteadmin list from scratch if you lose it (and I somehow
lose mind quite often).
I put the commands into a cron job so it auto creates if the site admin list
is null
I'm not sure how it pulls the information, but I assume it grabs it from the
passwd file (based on their home directory) and recreates the list.
if you add everyone via a script, then run these other commans, in theory it
would create the site user list for you.
export REMOTE_USER=admin
/usr/admserv/cgi-bin/.cobalt/siteUserList/siteUserList.cgi group=site22
Change the siteXX to whatever site you are adding to.
Remember, this will take a few mins to run
The script to add people would be somethign along the lines of
<--snip-->
#!/usr/bin/perl
open(IN,"userpasslist");
foreach $li (<IN>)
{
($user,$pass) = split(/\t/,$li); (assuming it is tab delimited)
`/usr/sbin/adduser $user -d etc etc etc`;
`rest of commands,etc`
};
close(IN);
<--snip-->
Lemm know how it turns out!