Article Title: Batch Modify remote linux Server passwords. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
#! /Bin/bash
# BY kerryhu
# MAIL: king_819@163.com
# BLOG: http://kerry.blog.51cto.com
# Please manual operation yum of before Operation .....
1. Establish trust relationships 192.168.9.203 is the Administrator 192.168.9.201 192.168.9.202 is a remote linux Server 1. Generate certificates and, [Root @ manage ~] # Ssh-keygen-t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/. ssh/id_rsa ): Enter passphrase (empty for no passphrase ): Enter same passphrase again: Your identification has been saved in/root/. ssh/id_rsa. (private key) Your public key has been saved in/root/. ssh/id_rsa.pub. (public key) The key fingerprint is: 36: ec: fc: db: b0: 7f: 81: 7e: d0: 1d: 36: 5e: 29: dd: 5b: a0 2. Send the public key on the management machine to each remote server. If the remote server changes the default ssh port number, use scp-P 17173,17173 as the port number. [Root @ manage. ssh] # scp id_rsa.pub 192.168.9.201:/root/. ssh/authorized_keys [Root @ manage. ssh] # scp id_rsa.pub 192.168.9.202:/root/. ssh/authorized_keys The management machine and remote host trust relationship have been established
[1] [2] Next page