Skip to content


user creation/password encryption in RedHat

To create a new user account simultaneously setting its password is a two step procedure.

a. encrypt the password (in this case the password is abc123)

# openssl passwd
Password:
Verifying - Password:
2n50KL0pCn096

b. call the useradd command to do the rest

# useradd -c 'testing gecos' -g oinstall \
-m -d /home/testing -p 2n50KL0pCn096 newuser

In the last case, the newuser login account will be associated with the group/groups called oinstall.

# groups newuser
newuser : oinstall

But if we create it replacing -g with -G:

# useradd -c 'testing gecos' -G oinstall \
-m -d /home/testing -p 2n50KL0pCn096 newuser

The new account primary group will be created automatically and called newuser and its group membership will be the list showing the following two grous newuser and oinstall.

# groups newuser
newuser: newuser, oinstall

Posted in Real life AIX.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2017 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.