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

This is a discussion on Automatizing user creation in HP-UX. Is it possible? - HP UX ; 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 ...

+ Reply to Thread
Results 1 to 9 of 9

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

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

    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.

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

    On Jul 14, 10:46*am, Sako wrote:
    > 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.


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

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

    On 14 jul, 16:59, OldSchool wrote:
    > On Jul 14, 10:46*am, Sako wrote:
    >
    >
    >
    > > 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.

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


    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.

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

    "Sako" wrote in message
    news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@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.



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

    On 15 jul, 05:36, "Kilgaard" wrote:
    > "Sako" wrote in message
    >
    > news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@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.


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

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

    On Jul 15, 3:06*am, Sako wrote:
    > On 15 jul, 05:36, "Kilgaard" wrote:
    >
    > > "Sako" wrote in message

    >
    > >news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@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.

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


    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 [-u [-o]] [-g ] [-G
    [,]] [-d ] [-s ] [-c ] [-m [-k
    ]] [-f ] [-e ]
    Usage: ./useradd.sam -D [-g ] [-b ] [-f ] [-
    e


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

    On 15 jul, 17:19, OldSchool wrote:
    > On Jul 15, 3:06*am, Sako wrote:
    >
    >
    >
    > > On 15 jul, 05:36, "Kilgaard" wrote:

    >
    > > > "Sako" wrote in message

    >
    > > >news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@r66g2000hsg.googlegroups.com....

    >
    > > > > I can't find slappasswd, or expect in my system, so I don't know ifit
    > > > > 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.

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

    >
    > 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 [-u [-o]] [-g ] [-G
    > [,]] [-d
    ] [-s ] [-c ] [-m [-k
    > ]] [-f ] [-e ]
    > Usage: ./useradd.sam -D [-g ] [-b ] [-f ] [-
    > e


    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

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

    On Jul 15, 11:26*am, Sako wrote:
    > On 15 jul, 17:19, OldSchool wrote:
    >
    >
    >
    >
    >
    > > On Jul 15, 3:06*am, Sako wrote:

    >
    > > > On 15 jul, 05:36, "Kilgaard" wrote:

    >
    > > > > "Sako" wrote in message

    >
    > > > >news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@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.

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

    >
    > > 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 [-u [-o]] [-g ] [-G
    > > [,]] [-d
    ] [-s ] [-c ] [-m [-k
    > > ]] [-f ] [-e ]
    > > Usage: ./useradd.sam -D [-g ] [-b ] [-f ] [-
    > > e

    >
    > 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- Hide quoted text -
    >
    > - Show quoted text -


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

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

    On 15 jul, 18:47, OldSchool wrote:
    > On Jul 15, 11:26*am, Sako wrote:
    >
    >
    >
    > > On 15 jul, 17:19, OldSchool wrote:

    >
    > > > On Jul 15, 3:06*am, Sako wrote:

    >
    > > > > On 15 jul, 05:36, "Kilgaard" wrote:

    >
    > > > > > "Sako" wrote in message

    >
    > > > > >news:74ed5b89-8b1b-4fbf-8e07-567e797dac20@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..

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

    >
    > > > 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 [-u [-o]] [-g ] [-G
    > > > [,]] [-d
    ] [-s ] [-c ] [-m [-k
    > > > ]] [-f ] [-e ]
    > > > Usage: ./useradd.sam -D [-g ] [-b ] [-f ] [-
    > > > e

    >
    > > 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- Hide quoted text -

    >
    > > - Show quoted text -

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


    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...ccounts.pl.txt

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

+ Reply to Thread