[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] Adduser Script
- Subject: RE: [cobalt-users] Adduser Script
- From: "Cobalt List" <cobaltlist@xxxxxxxxxxxx>
- Date: Wed Dec 6 15:06:57 2000
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Randy the script you entered below added the user perfect to the /etc/passwd
file
as I hoped it would.
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?
I also tried the commands you sent me to have them show up in the
userinterface but it did not seem to add them to the site.
Thanks for your help so far. So far no one has attempted to answer
any questions regarding this process.
I am testing all this on a test box so I am willing to get creative and
try things on this box as if something drastic happens I will just rebuild
and start over till I get this thing right.
Thanks again in advance for your help.
Jim
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Randy
Sent: Wednesday, December 06, 2000 9:32 AM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: Re: [cobalt-users] Adduser Script
> 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!
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users