1834345 Members
1706 Online
110066 Solutions
New Discussion

Using useradd.sam

 
Brendan Newport
Frequent Advisor

Using useradd.sam

I've found /usr/sam/lbin/useradd.sam and was hoping that perhaps it could provide a bit more functionality to the usual /usr/sbin/useradd, in that useradd.sam has a -p argument.

This would enable me to set initial passwords for specific accounts (useful when the account is being used by say, operators, and I don't want to provide a "set password at first login" option, 'cos the new password invariably doesn't get passed to all the shifts.)

Unfortunately, setting a users password with this flag renders the password unhashed in /etc/passwd and it is placed in the 2nd field as a literal string;


./useradd.sam -p password -u 801 -g 20 -d /home/test -s /usr/bin/ksh test


test:password:801:20::/home/test:/usr/bin/ksh

Anyone know any workarounds for being able to use the -p option in real life? For standard fixed accounts where a password is already in use on other machines, I can use the hashed password, but at the moment this -p implementation is a bit of a showstopper
"It doesn't have to be like this. All we need to do is make sure we keep talking"(Dave Gilmour)
2 REPLIES 2
justahuman
Advisor

Re: Using useradd.sam

Hi,
you can use useradd.sam -p ",.." ...
the new user than doesn?t have a Password but is forced by the next Login to change the password
Hier arbeitet die Firma Rast und Ruh; Vormittags geschlossen und Nachmittags ist zu !
Alan D Johnson
Occasional Advisor

Re: Using useradd.sam

If use usermod.sam -w "encryptedpasswd" it will put that in to the tcb/files/[a-z]/usename database entry. We used to use modprpw -w but they changed the behaviour in 11.x