Ploysh Bulk modification of Linux host passwords

Source: Internet
Author: User

Use of Polysh

Polysh is an interactive command that can be processed in batches to the server, which is ideal for applications where interactive processing is required, such as changing the root password. Use the Polysh command to quickly complete bulk modification of the server root password.

Polysh is a tool written in Python that can be installed directly using PIP

Pip install polysh==0.4 #python2.7 in the environment using version 0.4

The parameters of the Polysh are as follows:


Where--host-file is used to specify a list of IP addresses. --user used to specify the user to telnet to the server,--SSH is similar to the normal SSH command, where the port number and private key need to be specified

Before using Polysh, you need to copy the key to the remote server, as follows:

Ssh-keygen #生成密钥ssh-copy-id-i ~/.ssh/id_rsa.pub remote-host #将公钥上传给远程服务器

Then use Polysh to change the password in bulk

Polysh--ssh= ' exec ssh-p 22-i ~/.ssh/id_rsa '--user=root--hosts-file=host #host文件内容为定义好的主机地址

After the completion key is distributed to the remote server, it is possible to use Ploysh for interactive bulk Change password


Ploysh Bulk modification of Linux host passwords

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.