centos6.5配置ssh免秘鑰登陸執(zhí)行pssh命令的講解
1.檢查并安裝pssh,yum list pssh
2.因?yàn)闆]有配置免秘鑰登陸,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.拷貝到被管對(duì)象。
[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)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接
- CentOS7運(yùn)行.sh腳本提示syntax error: unexpected end of file的解決方法
- centOS6中使用crontab定時(shí)運(yùn)行執(zhí)行jar程序的腳本
- CentOS7如何執(zhí)行PHP定時(shí)任務(wù)詳解
- Centos 7下利用crontab定時(shí)執(zhí)行任務(wù)詳解
- 解決centos7 開機(jī)/etc/rc.local 不執(zhí)行的問題
- centos 設(shè)置定時(shí)任務(wù)執(zhí)行指定腳本的方法
- CentOS使用expect批量遠(yuǎn)程執(zhí)行腳本和命令
相關(guān)文章
在Linux中查找命令的執(zhí)行時(shí)間的幾種方法小結(jié)
在Linux系統(tǒng)中,了解命令的執(zhí)行時(shí)間對(duì)于優(yōu)化系統(tǒng)性能和提高效率至關(guān)重要,本文將介紹幾種方法來查找命令的執(zhí)行時(shí)間,包括內(nèi)置的time命令、GNU time工具、strace以及perf工具,需要的朋友可以參考下2024-05-05vmware中CentOS7網(wǎng)絡(luò)設(shè)置教程詳解
這篇文章主要為大家詳細(xì)介紹了vmware中CentOS7網(wǎng)絡(luò)設(shè)置教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07在Apache服務(wù)器中運(yùn)行CGI程序的方法
這篇文章主要介紹了在Apache服務(wù)器中運(yùn)行CGI程序的方法,文中以Perl腳本作為示例,需要的朋友可以參考下2015-07-07php擴(kuò)展memcached和memcache的安裝配置方法
這篇文章主要介紹了php擴(kuò)展memcached和memcache的安裝配置方法,需要的朋友可以參考下2014-11-11詳解如何在 Linux 中安裝最新的 Python 3.6 版本
本篇文章主要介紹了詳解如何在 Linux 中安裝最新的 Python 3.6 版本,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-03-03linux如何mount掛載磁盤并設(shè)置開機(jī)自動(dòng)mount的實(shí)現(xiàn)
這篇文章主要介紹了linux如何mount掛載磁盤并設(shè)置開機(jī)自動(dòng)mount的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09