Re: adding users from a file

From: Doug O'Leary (dkoleary_at_olearycomputers.com)
Date: 07/01/04


Date: Thu, 01 Jul 2004 13:06:26 GMT

In article <cbvff2$br8$1@news.Stanford.EDU>, Tony wrote:

> the file consist of users like this
>
> user1
> user2
> user3
> .
> .
> .
> .
> user20
>
> Then I want to set them a temporary password of something like abc123
>
> and also set their quota limit to be 250mb.
>

First, change the input file to:

user1:abc123:600:100:testing:/home/user1:/bin/bash
user2:abc123:601:100:testing:/home/user2:/bin/bash
user3:abc123:602:100:testing:/home/user3:/bin/bash
user4:abc123:603:100:testing:/home/user4:/bin/bash
user5:abc123:604:100:testing:/home/user5:/bin/bash
user6:abc123:605:100:testing:/home/user6:/bin/bash
user7:abc123:606:100:testing:/home/user7:/bin/bash
user8:abc123:607:100:testing:/home/user8:/bin/bash
user9:abc123:608:100:testing:/home/user9:/bin/bash
user10:abc123:609:100:testing:/home/user10:/bin/bash
user11:abc123:610:100:testing:/home/user11:/bin/bash
user12:abc123:611:100:testing:/home/user12:/bin/bash
user13:abc123:612:100:testing:/home/user13:/bin/bash
user14:abc123:613:100:testing:/home/user14:/bin/bash
user15:abc123:614:100:testing:/home/user15:/bin/bash

Second, run /usr/sbin/newusers ${pwd_file}

Third: (I don't have the quota subsystem on my system, so this is
from memory - and probably from another OS)

for user in $(awk -F: '{print $1}' ${pwd_file})
do
        quote 250m ${user}
done

HTH;

Doug

-- 
--------
Senior UNIX Admin
O'Leary Computer Enterprises
dkoleary@olearycomputers.com (w) 630-904-6098 (c) 630-248-2749
resume:  http://www.olearycomputers.com/resume.html