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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-15-2012, 07:53 AM
|
#1
|
LQ Newbie
Registered: May 2012
Posts: 4
Rep:
|
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
|
|
|
05-15-2012, 09:05 AM
|
#2
|
Member
Registered: May 2009
Location: Perth, AU
Distribution: LinuxMint
Posts: 389
Rep:
|
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.
|
|
|
05-15-2012, 09:55 PM
|
#3
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,723
|
I've never used it, but I've heard sysadmins recommend ClusterSSH for tasks involving large numbers of machines.
http://sourceforge.net/projects/clusterssh/
|
|
|
05-15-2012, 10:14 PM
|
#4
|
Member
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190
Rep:
|
also you can configure SSHPT, one of the great tool to maintain large number of servers.
|
|
|
05-16-2012, 05:53 AM
|
#5
|
LQ Newbie
Registered: May 2012
Posts: 4
Original Poster
Rep:
|
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:
|
|
|
05-16-2012, 06:35 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,452
|
do you mean you do not want to allow them to change their passwords?
there is a command to do that: passwd -l <user>
|
|
|
05-16-2012, 06:43 AM
|
#7
|
LQ Newbie
Registered: May 2012
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
05-16-2012, 07:14 AM
|
#8
|
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
|
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 07:20 AM.
|
|
|
05-16-2012, 09:32 AM
|
#9
|
Member
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190
Rep:
|
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
|
|
|
05-16-2012, 10:56 AM
|
#10
|
LQ Newbie
Registered: May 2012
Posts: 4
Original Poster
Rep:
|
We are working on Unix with AIX6.1 and executed the command but its prompting for the password.
|
|
|
05-16-2012, 11:11 AM
|
#11
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
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.
|
|
|
All times are GMT -5. The time now is 02:28 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|