pssh 提供了并行版本的 OpenSSH 工具,特别适合用来控制有大量机器需要连接的情况,包括并行版本的 ssh、scp、rsync 和 kill 命令。
发展壮大离不开广大客户长期以来的信赖与支持,我们将始终秉承“诚信为本、服务至上”的服务理念,坚持“二合一”的优良服务模式,真诚服务每家企业,认真做好每个细节,不断完善自我,成就企业,实现共赢。行业涉及成都楼梯护栏等,在网站建设、全网整合营销推广、WAP手机网站、VI设计、软件开发等项目上具有丰富的设计经验。
[root@localhost ~]# wget https://files.pythonhosted.org/packages/60/9a/8035af3a7d3d1617ae2c7c174efa4f154e5bf9c24b36b623413b38be8e4a/pssh-2.3.1.tar.gz
[root@localhost ~]# yum install -y make gcc gcc++ python-devel python-pip
[root@localhost ~]# tar xf pssh-2.3.1.tar.gz
[root@localhost ~]# cd pssh-2.3.1
[root@localhost ~]# python setup.py install
[root@localhost ~]# ssh-keygen
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.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:3antaxjGw+hdgfSlrXLYhUe5vgHe9b0ehh/gUY9E8Eg root@localhost.localdomain
The key's randomart image is: +---[RSA 2048]----+ | E... | | .. ++ | | . o.*oo | | ...*o*.o| | S+.+o@..+| | . OoB B o| | . o.B.o *.| | . o.. +.o| | .o..o | +----[SHA256]-----+ [root@localhost ~]# cd /root/.ssh/ [root@localhost .ssh]# ls id_rsa id_rsa.pub [root@localhost .ssh]# ssh-copy-id 172.16.1.112 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '172.16.1.112 (172.16.1.112)' can't be established.
ECDSA key fingerprint is SHA256:yFvaxR1x5YDhhe+6xR/Ou6Sm+YPYvPAoiLVKt9mAnXA.
ECDSA key fingerprint is MD5:0d:c4:79:bc:36:7a:a4:82:95:4f:d5:d0:a3:c8:7d:2e.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@172.16.1.112's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '172.16.1.112'" and check to make sure that only the key(s) you wanted were added. [root@localhost .ssh]# ssh-copy-id 172.16.1.16 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '172.16.1.16 (172.16.1.16)' can't be established.
ECDSA key fingerprint is SHA256:ANzlXzrGA87YLI2vzkPJ/iNPiSQ5JStJc95948jE8aw.
ECDSA key fingerprint is MD5:f9:f1:1b:5a:99:64:d8:d8:e9:9b:e6:bb:c3:d5:bd:e7.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@172.16.1.16's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '172.16.1.16'" and check to make sure that only the key(s) you wanted were added.
[root@localhost ~]# ssh 172.16.1.112
Last login: Tue Jun 2 09:44:24 2020 from 172.16.1.16
[root@localhost ~]# ssh 172.16.1.16
Last login: Tue Jun 2 09:30:47 2020 from 172.16.1.100
[root@localhost ~]# cat aaa
172.16.1.16
172.16.1.112
[root@localhost ~]# pssh -h aaa -l root -P "date"
172.16.1.16: 2020年 06月 02日 星期二 09:59:48 CST
[1] 09:59:48 [SUCCESS] 172.16.1.16
172.16.1.112: 2020年 06月 02日 星期二 09:59:48 CST
[2] 09:59:48 [SUCCESS] 172.16.1.112
[root@localhost ~]# pssh -h aaa -l root -P "lsblk"
172.16.1.16: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─centos-root 253:0 0 17G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sr0 11:0 1 4.2G 0 rom
[1] 10:13:02 [SUCCESS] 172.16.1.16
172.16.1.112: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─centos-root 253:0 0 17G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sr0 11:0 1 4.2G 0 rom
[2] 10:13:03 [SUCCESS] 172.16.1.112
文章标题:Centos7中安装轻量级运维利器:pssh
新闻来源:http://www.mswzjz.cn/qtweb/news14/214914.html
攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能