Operating System - HP-UX
1758831 Members
3222 Online
108876 Solutions
New Discussion юеВ

Adding users with trusted systems

 
SOLVED
Go to solution
Travis Harp
Advisor

Adding users with trusted systems

I've been adding user via sam for a while now but I'm trying to develop a script to make this task less time consuming.

Does the useradd.sam command work correctly when used on a trusted system and is there anything that I need to know before going forward?

Thanks
Eagles may soar but weasels don't get sucked into jet engines.
17 REPLIES 17
Camel_1
Valued Contributor

Re: Adding users with trusted systems

useradd command works the same on btoh trusted/notrusted system.

Simon
Uday_S_Ankolekar
Honored Contributor

Re: Adding users with trusted systems

/usr/sbin/useradd command should workwell with your scripts.

-USA..
Good Luck..
Hoefnix
Honored Contributor

Re: Adding users with trusted systems

just tested and useradd works in trusted system.
regards,

Peter
Darren Prior
Honored Contributor

Re: Adding users with trusted systems

Hi Travis,

The main point you should know is that it's not supported to use the useradd.sam script. It's only designed to be used internally by SAM and it's possible that it could get changed by a patch.

Please also consider assigning points to those that have given their time to help you. It's free, plus it helps others decide which answers have been useful.

regards,

Darren.
Calm down. It's only ones and zeros...
Jeff Schussele
Honored Contributor
Solution

Re: Adding users with trusted systems

Hi Travis,

As noted /usr/sbin/useradd (and /usr/sbin/groupadd as well) work the same in both envs.
Would be used as follows:

/usr/sbin/useradd -u UID -g GID -d /home/username -m -s /usr/bin/ksh -c "Comments here - maybe full name" username

The GID must exist or you'll have to create it fisrt - with groupadd if you wish.
The home dir can be wherever you normally put them & the -m states to make (create) the dir if it doesn't exist. We use the -c for full user name & affiliation (what group they're with or phone #, etc.). And of course you can give them whatever valid shell you wish or they want.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sridhar Bhaskarla
Honored Contributor

Re: Adding users with trusted systems

Hi,

Useradd is the command you should be using as pointed already.

However, with useradd you will not be able to set the password. If you have an encrypted password for the user (you can generate the encrypted password using the 'makekey' command in /usr/lib) and add it using the command

/usr/sam/lbin/usermod.sam -p abjHqL18xWq0A user

Here abjHqL18xWq0A is the encrypted password.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Mic V.
Esteemed Contributor

Re: Adding users with trusted systems

I hacked out a C program to handle setting the password with straight useradd. It just did getpwent, etc. Wasn't too bad once I thought it out. Sorry, can't post the code.
What kind of a name is 'Wolverine'?
Bill Hassell
Honored Contributor

Re: Adding users with trusted systems

Attached is a really simple C program to generate an encrypted password. usermod.sam has not changed in several revs and still works to modify the password (whether Trusted or not) in both 11.0 and 11.11 (and 10.20 for that matter). So you can use the output of this program as the encrypted password to pass to usermod.sam


Bill Hassell, sysadmin
Travis Harp
Advisor

Re: Adding users with trusted systems

Ok I'm making some good progress here thanks to everyone's help but I'm having an issue getting the password set.

I've been using makekey to get the encrypted password as suggested but when I use the usermod.sam -p it doesn't seem to take.

As a test I tried to su to one of these accounts and the password I just put in doesn't work, I've tried it unencrypted as well with no better results.

What am I doing wrong here?
Eagles may soar but weasels don't get sucked into jet engines.