Plink tool full command line remote batch shutdown script

Source: Internet
Author: User
My operating system is centos6.4 Operating system: rhel6.2x86 _ 64 download and install putty software package, I downloaded the putty-0.62-1.el6.rf.x86_64.rpm as follows: http://rpm.pbone.net/index.php31?remote ?ip=file =root@localhost=] # Vimserv

My operating system is centos6.4

 

Operating system: rhel 6.2 x86_64
Download and install the putty software package, I download the putty-0.62-1.el6.rf.x86_64.rpm
Http://rpm.pbone.net/index.php3:
1. remote host IP list file

[Root @ localhost ~] # Vim server_list.txt

192.168.0.13
192.168.0.12
192.168.0.11

2. files of the operations to be performed on the remote host

[Root @ localhost ~] # Vim shutdown.txt

Shutdown-h now


3. remote shutdown automation script

[Root @ localhost ~] # Vim remote_shutdown.sh

For I in 'cat server_list.txt'
Do
Plink-l root $ I-pw redhat-m/shutdown.txt <
For example:
Vim remote_shutdown.sh

Plink-l root 192.168.0.12-pw password1-m/shutdown.txt
Plink-l jane 192.168.0.35-pw password2-m/shutdown.txt
Plink-l paul 192.168.0.77-pw password3-m/shutdown.txt
Plink-l root 192.168.0.19-pw password4-m/shutdown.txt (or plink root@192.168.0.19-pw password4-m/shutdown.txt)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.