Hello,

I created a user by importing a ldif as showb below:

Plz go through this  file. However this file  is located at the LDAP server and 
the homedirectories are to created in the cluster server.dn: 
uid=s08-1-5-097,ou=student,dc=nits,dc=ac,dc=in
uid: s08-1-5-097
cn:  s08-1-5-097
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$REie6fpE$5brEKmdMZlWzxStz7Kqed.
loginShell: /bin/bash
uidNumber: 3053
gidNumber: 3053
homeDirectory: /mnt/btech/s08-1-5-097
shadowLastChange:13458
shadowMin: 0
shadowMax: 999999
shadowWarning: 7




I tried excuting the script like too, still the /etc/group was not updated , 
why ?  The script is shown below:





#!/usr/local/bin/perl

use strict;
use warnings;

open(FH,"/mnt/btech/rr.txt");
while(<FH>)
 {
   chomp($_);
   my $homedir = "/mnt/btech/$_";
   `groupadd $_`;
   `mkdir "$homedir"; chmod 700 "$homedir";` if(! -e $homedir);
}
close(FH);

what could be wrong with the script ?


--- On Wed, 8/20/08, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
From: Mr. Shawn H. Corey <[EMAIL PROTECTED]>
Subject: Re: What is wrong with this script ??
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Date: Wednesday, August 20, 2008, 7:01 PM

On Wed, 2008-08-20 at 06:11 -0700, Jyotishmaan Ray wrote:
> Yes, a user uid has already been created in aLDAP server which does 
centralised authentication.
> 
> And these home directories were created on a clusetr server machine for
students to work out theur assignments etc.

Then you have to change the user creation process to also create the
group.


-- 
Just my 0.00000002 million dollars worth,
  Shawn

"Where there's duct tape, there's hope."

"Perl is the duct tape of the Internet."
        Hassan Schroeder, Sun's first webmaster




      

Reply via email to