centos6.5配置ssh免秘鑰登陸執(zhí)行pssh命令的講解
1.檢查并安裝pssh,yum list pssh
2.因為沒有配置免秘鑰登陸,pssh命令執(zhí)行失敗。
[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命令執(zhí)行成功。
[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
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,謝謝大家對腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請查看下面相關(guān)鏈接
- Xshell從會話同步到磁盤遷移的完整配置指南
- Xshell連接本地Linux虛擬機(jī)方式
- 一步步教你配置并使用Xshell7免費版
- 解決xshell連接服務(wù)器報找不到匹配的host?key算法問題
- Xshell?6安裝和使用教程詳解
- XShell免費版的安裝配置教程及使用保姆級教程
- 使用Django和Ansible實現(xiàn)自動化部署方式
- 利用Ansible實現(xiàn)批量服務(wù)器自動化管理詳解
- ansible執(zhí)行shell腳本的方法
- Linux系統(tǒng)實現(xiàn)ansible自動化安裝配置httpd的方法
- 使用PSSH批量管理Linux服務(wù)器
- 多服務(wù)器批量管理工具對比與選型:從Xshell到自動化運維
相關(guān)文章
centos7 設(shè)置grub密碼及單用戶登錄實例代碼
這篇文章主要介紹了centos7 設(shè)置grub密碼及單用戶登錄實例代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-11-11
在Linux服務(wù)器中查看運行的服務(wù)的方法匯總
在云服務(wù)器中,查看服務(wù)器具體運行的服務(wù)可以通過多種方法實現(xiàn),具體的方法取決于你所使用的操作系統(tǒng),常見的云服務(wù)器操作系統(tǒng)包括Linux(例如Ubuntu、CentOS等)和Windows Server,下面將分別介紹如何在這兩種操作系統(tǒng)中查看正在運行的服務(wù),需要的朋友可以參考下2025-05-05
讓Apache 2支持.htaccess并實現(xiàn)目錄加密的方法
這篇文章主要介紹了讓Apache 2支持.htaccess并實現(xiàn)目錄加密的方法,文中給出了詳細(xì)的方法步驟,并給出了示例代碼,對大家具有一定的參考價值,需要的朋友們下面來一起看看吧。2017-02-02
Centos8(最小化安裝)全新安裝Python3.8+pip的方法教程
這篇文章主要介紹了Centos8(最小化安裝)全新安裝Python3.8+pip的方法教程,本文給大家整理了一份命令,需要的朋友可以參考下2020-02-02
Git開發(fā)分支合并到develop分支實現(xiàn)方式
文章詳細(xì)介紹了如何在Git中將本地開發(fā)分支合并到develop分支,包括創(chuàng)建分支、開發(fā)、提交、切換分支、合并分支、解決沖突以及版本回退等步驟,同時,還提到了一些常用的Git命令和操作,如git reset、git log和git push等2026-01-01

