VMware Cloud Community
zhangfred_vm
Contributor
Contributor

Is there way to change /etc/hosts files from the scripts

Hi Friends,

As we want to change the /etc/hosts for many esx servers, is there way to change the the /etc/hosts of all the esx servers, using the scrips?

Reply
0 Kudos
2 Replies
arturka
Expert
Expert

Hi

Should be possible, you can run bash script from Linux server or from one of yours ESX servers against all ESX servers. If you wanna do it without typing pass for every server you should consider place your public ssh keys on all ESX servers. How to log in to Linux without pass can be found very quickly in google e.g.

http://magicmonster.com/kb/net/ssh/auto_login.html

Cheers

Artur

Visit my blog

Please, don't forget the awarding points for "helpful" and/or "correct" answers.
VCDX77 My blog - http://vmwaremine.com
Reply
0 Kudos
jamesbowling
VMware Employee
VMware Employee

Or you could just use an expect script to login to everything.  I would imagine that this would also be possible with the use of PowerCLI.

James B. | Blog: http://www.vSential.com | Twitter: @vSential --- If you found this helpful then please awards helpful or correct points accordingly. Thanks!
Reply
0 Kudos