Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automatizing user creation in HP-UX. Is it possible?

2 views
Skip to first unread message

Sako

unread,
Jul 14, 2008, 10:46:10 AM7/14/08
to
Thanks in advance, and excuse my English.

We have 4 nodes runing hp-ux HP-UX XX B.11.11 U 9000/800 ##
Each one of them has local user management. User generation it's done
via "SAM", so we wanted to make this quicker to admin.

I've thought about a script, wich seems to run perfectly on a normal
linux machine, but I'm not sure of how could it work, nor even it its
"safe" to do it in a HP-UX enviropment.

This is how I'd do it :
#!/bin/bash
#$1 = user name entry
# PASSWORD stores the encrypted password matching the username
PASSWORD = `slappasswd -h {MD5} -c '$1$%.8s' -s "$1" | cut -d} -f2`
useradd -d /opt/oracle/app/home/"$1" -m -g MYGROUP -p "$PASSWORD" "$1"

I can't find slappasswd, or expect in my system, so I don't know if it
would be safe to run this. Once It runs in a node I would send the
commands via ssh to all nodes involved.

If other options are avaliable, I don't want to rediscover what's
already done.

thanks & regards.

OldSchool

unread,
Jul 14, 2008, 10:59:31 AM7/14/08
to

take a look at the command "/usr/sam/lbin/useradd.sam"

Sako

unread,
Jul 14, 2008, 11:16:57 AM7/14/08
to

Thks.
It seems there isn't an option to insert the passwd with the useradd
command.
I'll keep working, hope I can automatize this.

Kilgaard

unread,
Jul 14, 2008, 11:36:09 PM7/14/08
to
"Sako" <lluis.c...@gmail.com> wrote in message
news:74ed5b89-8b1b-4fbf...@r66g2000hsg.googlegroups.com...

> I can't find slappasswd, or expect in my system, so I don't know if it
> would be safe to run this. Once It runs in a node I would send the
> commands via ssh to all nodes involved.
>
> If other options are avaliable, I don't want to rediscover what's
> already done.
>

Expect can be found here:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.43/

I use this to feed password resets to 'passwd' via an ssh session.


Sako

unread,
Jul 15, 2008, 3:06:36 AM7/15/08
to
On 15 jul, 05:36, "Kilgaard" <Kilga...@hotmail.com> wrote:
> "Sako" <lluis.cleme...@gmail.com> wrote in message

Thanks, I've seen expect working on linux so I think there will be no
problem.
keep working , still scripting.

OldSchool

unread,
Jul 15, 2008, 11:19:33 AM7/15/08
to

re-read what I said....not "useradd" but "useradd.sam" from the SAM
tool

./useradd.sam

Either -D or user must be specified
Usage: ./useradd.sam [-p <passwd> [-u <uid> [-o]] [-g <group>] [-G
<group>[,<group...>]] [-d <dir>] [-s <shell>] [-c <comment>] [-m [-k
<skel dir>]] [-f <inactive>] [-e <expire>] <login>
Usage: ./useradd.sam -D [-g <group>] [-b <base dir>] [-f <inactive>] [-
e <expire>

Sako

unread,
Jul 15, 2008, 11:26:05 AM7/15/08
to

Thanks , it was my fault, i saw the link and got confused, you are
right about it.
lrwxr-xr-x root sys useradd.sam -> /usr/sbin/useradd

keep working

OldSchool

unread,
Jul 15, 2008, 12:47:34 PM7/15/08
to
> keep working- Hide quoted text -
>
> - Show quoted text -

ok...so does it suffice for your needs or not (as it does have the "-p
password" option)?

Sako

unread,
Jul 16, 2008, 4:50:20 AM7/16/08
to

It was fine , but I'll still need to pass a MD5 pre-encrypted passwd,
and I didn't find the needed commands in my server.

Found this ins other sources :
http://www.circlingcycle.com.au/Unix-sources/add-batch-Unix-accounts.pl.txt

I'm trying to split it so I get what I need.
Thanks to you all!

0 new messages