LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
  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: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380Reputation: 2380
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: 15,984

Rep: Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970Reputation: 2970
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: 558
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, Ubuntu, Amazon Linux
Posts: 1,814
Blog Entries: 20

Rep: Reputation: 117Reputation: 117
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


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 03:56 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration