centos6.5配置ssh免秘钥登陆执行pssh命令的讲解
作者:zsx0728 时间:2023-04-19 12:42:34
1.检查并安装pssh,yum list pssh
2.因为没有配置免秘钥登陆,pssh命令执行失败。
[root@bogon ]# pssh -H root@192.168.245.129 -i uptime
[1] 11:00:36 [FAILURE] root@192.168.245.129 Exited with error code 255
Stderr: The authenticity of host '192.168.245.129 (192.168.245.129)' can't be established.
RSA key fingerprint is 84:2d:70:33:1c:45:fa:e6:4b:94:72:7e:10:98:7c:a8.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
3.生成秘钥。
[root@bogon tmp]# 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.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
9e:14:9a:cc:8d:9b:fd:51:c5:68:24:e1:ce:c6:d7:33 root@bogon
The key's randomart image is:
+--[ RSA 2048]----+
| o.. |
| . o o |
| . . o o |
| o = = . o |
| * S = o E |
| * o o o |
| o + . |
| . . |
| . |
+-----------------+
[root@bogon .ssh]# ll
total 8
-rw------- 1 root root 1675 Aug 22 11:06 id_rsa
-rw-r--r-- 1 root root 392 Aug 22 11:06 id_rsa.pub
4.拷贝到被管对象。
[root@bogon .ssh]# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.245.129
The authenticity of host '192.168.245.129 (192.168.245.129)' can't be established.
RSA key fingerprint is 84:2d:70:33:1c:45:fa:e6:4b:94:72:7e:10:98:7c:a8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.245.129' (RSA) to the list of known hosts.
reverse mapping checking getaddrinfo for bogon [192.168.245.129] failed - POSSIBLE BREAK-IN ATTEMPT!
root@192.168.245.129's password:
Now try logging into the machine, with "ssh 'root@192.168.245.129'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
5.pssh命令执行成功。
[root@bogon .ssh]# pssh -H root@192.168.245.129 -i uptime
[1] 11:10:39 [SUCCESS] root@192.168.245.129
20:10:39 up 2:07, 1 user, load average: 0.00, 0.00, 0.00
来源:https://blog.csdn.net/zsx0728/article/details/81940736
标签:centos,ssh,免秘钥登陆,pssh命令
0
投稿
猜你喜欢
详解Apache中.htaccess文件的功能
2008-04-24 19:15:00
安全设置微软IIS服务器的三个小技巧
2009-07-27 11:20:00
淘特Asp.Net Cms2.0推出 新增TAG等功能
2010-05-27 09:06:00
21个常用的apache .htaccess文件配置技巧分享
2023-07-18 21:40:21
Google防止垃圾评论的战役
2007-12-15 08:30:00
日IP200的地方门户网站赚钱之道
2007-09-12 12:26:00
Centos7上Mesos和Marathon的安装和配置
2023-07-17 21:52:48
Linux chkconfig 命令的使用
2023-09-01 10:25:37
利用分类信息平台进行有效的网上推广
2009-01-22 20:53:00
十八般武艺 谈谈如何提高你的博客的人气
2009-03-16 08:40:00
VMware WorkStation的三种网络连接方式详解
2021-04-08 18:18:48
Windows服务器下的IIS和Apache性能比较
2008-04-06 14:10:00
Ubuntu 16.04安装使用Docker教程
2021-11-18 10:11:23
动易CMS产品SiteFactory 3.6正式发布
2010-09-29 21:31:00
Linux中利用Procmail来反击垃圾邮件
2010-03-11 19:14:00
技巧:实现IIS与Apache共用80端口
2007-09-06 13:38:00
使用IIS的Url重定向功能防止数据库被下载
2008-02-28 12:47:00
动易SiteWeaver利用自定义标签实现随机文章列表
2009-03-12 18:22:00
Linux环境下架设DNS服务器教程
2009-02-04 12:47:00
Serv-U域自动离线
2009-04-29 19:19:00