LinuxQuestions.org
Visit Jeremy's Blog.
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 05-15-2012, 06:53 AM   #1
chandrasekhar.datrika
LQ Newbie
 
Registered: May 2012
Posts: 4

Rep: Reputation: Disabled
Reset the password automatically


Hi Leaders,

I have to reset the password of almost 100 unix users automatically. Can you please suggest any script to perform this activity. Thank you in advance.

Regards,
Rama
 
Old 05-15-2012, 08:05 AM   #2
pierre2
Member
 
Registered: May 2009
Location: Perth, AU
Distribution: LinuxMint
Posts: 368
Blog Entries: 8

Rep: Reputation: 85
In their user profile, under settings,
there is usually a setting/checkbox to 'time limit' their password.

- forcing them to change it on a set/regular basis.

you may have to this change manually - on all those machines.
 
Old 05-15-2012, 08:55 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,372
Blog Entries: 16

Rep: Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147
I've never used it, but I've heard sysadmins recommend ClusterSSH for tasks involving large numbers of machines.

http://sourceforge.net/projects/clusterssh/
 
Old 05-15-2012, 09:14 PM   #4
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
also you can configure SSHPT, one of the great tool to maintain large number of servers.
 
Old 05-16-2012, 04:53 AM   #5
chandrasekhar.datrika
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi,

My question is to automatically pass the default password when we try to do the below activity.

$ passwd user01
Changing password for "user01"
user01's Old password:
user01's New password:
Enter the new password again:
 
Old 05-16-2012, 05:35 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,439

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
do you mean you do not want to allow them to change their passwords?
there is a command to do that: passwd -l <user>
 
Old 05-16-2012, 05:43 AM   #7
chandrasekhar.datrika
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
No. I have created 100+ unix users (for example user01, user02, ... user150 ect). Once the creation of users is done, we have to set the password for further login with the created user. For that we will issue the below command with root user at unix prompt.

$ passwd user01

This will prompt the user to issue the password and confirm password. Now, these two ( password and confirm password) should be updated with default password ( like happy1 ) without user interaction. for this I want the shell script. This is my requirement. Not sure how to implement. Requesting you to please suggest a way. Thank you in advance.
 
Old 05-16-2012, 06:14 AM   #8
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
You can put this command in a file and execute that file-
Quote:
echo "username:newpasswd" | /usr/sbin/chpasswd
give the file executable permission and copy the file on remote host and execute.

For more detail you can take help from this link - http://fclose.com/b/linux/3198/chang...-command-line/.

Last edited by Satyaveer Arya; 05-16-2012 at 06:20 AM.
 
Old 05-16-2012, 08:32 AM   #9
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
if you are using redhat based linux distro you can use this command


Code:
echo happy1 | passwd --stdin user01
it will not give you another prompt to set the password
 
Old 05-16-2012, 09:56 AM   #10
chandrasekhar.datrika
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
We are working on Unix with AIX6.1 and executed the command but its prompting for the password.
 
Old 05-16-2012, 10:11 AM   #11
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,732

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
Could you pipe names and passwords to chpasswd?
http://pic.dhe.ibm.com/infocenter/ai...1/chpasswd.htm
I did a quick try and the following worked, so presumeably you could pipe a file to it:
Code:
echo "me:password" | chpasswd
Where me is the username and the password is set to the word password.
 
  


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
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
MPlayer sound gets reset automatically gregorian Linux - Software 3 02-21-2007 03:07 AM
Permissions home dir reset automatically Marco Vermunt Linux - Newbie 1 01-24-2005 01:50 PM
Why was the relocated /tmp write permission automatically reset (lost)? wirawan0 Mandriva 2 06-26-2004 07:33 PM
reset the password ust Linux - General 1 02-11-2004 06:35 AM

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

All times are GMT -5. The time now is 09:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration