Batch Modify remote linux Server passwords

Source: Internet
Author: User
Tags ssh port
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

Related Article

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.