LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Create user and set passwd in AIX (https://www.linuxquestions.org/questions/linux-newbie-8/create-user-and-set-passwd-in-aix-4175479867/)

kingissingh@gmail.com 10-07-2013 12:34 AM

Create user and set passwd in AIX
 
Hi Guys,

Is there any way I can create user and set its passwd in a single line in AIX.
I'm able to do this in Linux(RHEL) but want to replicate the same in AIX.

$useradd -c 'firstnam lastname' -g group1 -n -s /bin/ksh id1234; echo id1234password | passwd id1234 --stdin

I have tried the following but doesn't seem to work:

$mkuser pgrp='group1' gecos='firstname lastname' id1234 ; echo idpassword |passwd id1234 --stdin


Any help is much appreciated.

TB0ne 10-08-2013 09:07 AM

Quote:

Originally Posted by kingissingh@gmail.com (Post 5041282)
Hi Guys,
Is there any way I can create user and set its passwd in a single line in AIX. I'm able to do this in Linux(RHEL) but want to replicate the same in AIX.

$useradd -c 'firstnam lastname' -g group1 -n -s /bin/ksh id1234; echo id1234password | passwd id1234 --stdin

I have tried the following but doesn't seem to work:

$mkuser pgrp='group1' gecos='firstname lastname' id1234 ; echo idpassword |passwd id1234 --stdin

Take a look at the chpasswd command. Try doing something like:
Code:

echo "id1234:id1234password" | /bin/chpasswd -c
There is also an AIX forum here, since this really isn't a Linux question, which may get you AIX answers faster next time.

kingissingh@gmail.com 10-08-2013 10:01 PM

Hey TB0ne thank you for the reply. I will post in respective forum this was the reason why I was not getting any answers.
Thank you again for the solution provided it helped me.

Appreciate It!


All times are GMT -5. The time now is 10:31 PM.