LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 02-08-2013, 10:18 PM   #1
redhat70
Member
 
Registered: May 2012
Posts: 86

Rep: Reputation: Disabled
Change password with out any prompt, How ?


Hi,

I want to create the users and set the passwords to 'eW4hNXNIc' for all new users.I don't want any prompts or confirmation when creating the users.

Is there a way to achieve this in REDHAT LINUX ? Can some one help?


regards,
aparna.
 
Old 02-09-2013, 01:30 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by redhat70 View Post
I want to create the users and set the passwords to 'eW4hNXNIc' for all new users.I don't want any prompts or confirmation when creating the users.

Is there a way to achieve this in REDHAT LINUX ? Can some one help?
You can do the following when using RedHat:
Code:
# create user the normal way:
$ /usr/sbin/useradd -c "Comment goes here" -m -d /home/username -s /bin/bash -u 500 -g 500 username

# set password:
/bin/echo "very_secret" | passwd --stdin username
To my knowledge the password --stdin username construct is only supported in RedHat and RedHat based distro's.
 
Old 02-09-2013, 09:05 AM   #3
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 13,774

Rep: Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346Reputation: 2346
Quote:
Originally Posted by redhat70 View Post
Hi,
I want to create the users and set the passwords to 'eW4hNXNIc' for all new users.I don't want any prompts or confirmation when creating the users.
Is there a way to achieve this in REDHAT LINUX ? Can some one help?
Along the same lines of your very first post here last year:
http://www.linuxquestions.org/questi...-boxes-947742/

You've been here a year now, and you seem to only want us to look things up for you.
 
Old 02-09-2013, 02:23 PM   #4
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 548
Blog Entries: 5

Rep: Reputation: Disabled
The below command works fine in my Dedian & Ubuntu based Operating system

echo "username:password" | chpasswd

Last edited by arun5002; 02-09-2013 at 02:24 PM.
 
Old 02-10-2013, 02:02 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by arun5002 View Post
The below command works fine in my Dedian & Ubuntu based Operating system

echo "username:password" | chpasswd
I've seen cases where that kind of thing fails due to stdin not being a tty (picky program reading for the password). In such cases I've usually found that the "script" program (and a delay in sending in the password) works. The "expect" program (or "pexpect" with a Python script) can also help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] chage -d 0 does not prompt for password change on first login sbtiwari Linux - Newbie 2 07-21-2009 06:34 PM
Samba, Vista, Mapped Drives, and change password prompt mrog Linux - Networking 2 09-30-2008 08:01 AM
automatically prompt user to change password guy_ripper Linux - Security 7 01-18-2007 01:57 PM
How do you change login/password prompt? cnewtonne Linux - Security 7 11-16-2006 02:54 PM


All times are GMT -5. The time now is 11:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration