Dear All,
I am having a script which is using the useradd command to create a new user.
it was working fine in solaris but now in HP UX i am getting a prolem. though almost al the option which are available with command are same.
i am using below options
[-c comment]
[-m [-k skel_dir]]
[-d dir]
[-g group] - Security Groupname
[-G group [, group...]]
[-s shell]
[-k skel_dir]
when the script will run it will add the user in /etc/passwd and first the new created account will in locked status.
below is the code which is used to create a account.
my $pUserID = shift(@_);
my $su;
my $Cmd = $myConfig::Configuration{useradd};
my @CmdArgs = ('-c', 'my Account for ' . $myConfig::Configuration{InstanceName} . ' instance',
'-m', '-d', $myConfig::Configuration{AccountHome}."/".lc($pUserID),
'-g', $myConfig::Configuration{SecurityGroupName},
'-G', 'myscr',
'-s', '/bin/ksh',
'-k', $myConfig::Configuration{AccountHome}."/".$myConfig::Configuration{StdAccountName},lc($pUserID));
$su = Sudo->new(
{
sudo => $myConfig::Configuration{sudo}
,sudo_args => ''
,username => "root"
,program => $Cmd
,program_args => \@CmdArgs
}
when i run it in HP US i get below entry in Passwd file
ARRAY(0x6000000000aca598):x:117:20::/home/ARRAY(0x6000000000aca598):/sbin/sh ARRAY(0x6000000000aca638):x:118:20::/home/ARRAY(0x6000000000aca638):/sbin/sh
can somebody guide me about error.
To unlock the account i have planned to use /usr/lbin/modprpw with -k which is silmilar to passwd -u but no idea what will be outcome.
Please suggest why strange entry in /ect/passwd file and suggestion