LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2013, 12:34 AM   #1
kingissingh@gmail.com
LQ Newbie
 
Registered: May 2013
Distribution: Ubuntu,Fedora,CentOS,Solaris 10, RHEL
Posts: 6

Rep: Reputation: Disabled
Cool 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.
 
Old 10-08-2013, 09:07 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by kingissingh@gmail.com View Post
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.
 
1 members found this post helpful.
Old 10-08-2013, 10:01 PM   #3
kingissingh@gmail.com
LQ Newbie
 
Registered: May 2013
Distribution: Ubuntu,Fedora,CentOS,Solaris 10, RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NIS server:- how to set user must change his passwd on first login form client anujkaushal Linux - Server 4 09-07-2011 01:11 AM
[SOLVED] SFTP with user nectand passwd set on the header of connection MarcosPauloBR Linux - Newbie 1 03-25-2011 01:55 PM
create a user who can also run useradd and passwd only kkeith Linux - Newbie 5 06-29-2006 06:43 AM
ow to create script change a user's password? passwd expects input from keyboard.. Arodef Linux - General 1 03-02-2005 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration