LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-03-2016, 03:19 PM   #1
Abella
LQ Newbie
 
Registered: Jun 2016
Posts: 1

Rep: Reputation: Disabled
Massive change of password


Hi everyone,

I need to change ‘user’ passkey in all Linux Virtual Machines inside a server cluster. Any aid for creating a script that can change passkey to a user in all the servers?

I’ll be keen to hear good feedback and help.

Thanks
Abella
 
Old 06-03-2016, 05:41 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
how many VM's ?

if only 5 or 6

just change them
 
Old 06-03-2016, 06:23 PM   #3
Upuetz
Member
 
Registered: May 2016
Location: Aachen
Distribution: Debian, CentOS, Ubuntu, Raspian, tinycore
Posts: 59

Rep: Reputation: Disabled
#!/bin/bash

for i in server1 server2 server3
do
ssh $i 'sed -i -e "s/<oldkey>/<newkey/" <path-to-keyfile>"
done

#HTH ;-)
#Upuetz
 
  


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
Ubuntu 11.04 encrypted LVM password not working after user login password change prateekm21 Linux - Security 0 10-29-2011 01:20 PM
Change my root password in Debian Linux if I have the current password? panseluta Linux - Newbie 2 12-28-2008 02:02 AM
Locking out a user when password expires, but allowing them to change their password kaplan71 Linux - Security 5 06-27-2008 07:12 PM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:08 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
Open Source Consulting | Domain Registration