centos6.5配置ssh免秘鑰登陸執(zhí)行pssh命令的講解
1.檢查并安裝pssh,yum list pssh
2.因?yàn)闆](méi)有配置免秘鑰登陸,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é)
以上就是這篇文章的全部?jī)?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 開(kāi)機(jī)/etc/rc.local 不執(zhí)行的問(wèn)題
- centos 設(shè)置定時(shí)任務(wù)執(zhí)行指定腳本的方法
- CentOS使用expect批量遠(yuǎn)程執(zhí)行腳本和命令
相關(guān)文章
Linux虛擬機(jī)ipaddr/ifconfig不顯示IP的解決方案(親測(cè)有效)
有時(shí)候經(jīng)常會(huì)出現(xiàn)之前明明好的,但是換了個(gè)網(wǎng)絡(luò)就查不到ip了,由于不知道原因,有的人會(huì)選擇重裝虛擬機(jī),還有的人開(kāi)始崩潰,本篇文章將徹底解決該問(wèn)題的出現(xiàn),需要的朋友可以參考下2023-09-09
Linux定時(shí)任務(wù)Crontab的使用方法
這篇文章主要為大家詳細(xì)介紹了Linux定時(shí)任務(wù)Crontab的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-12-12
linux查看文件系統(tǒng)塊大小與內(nèi)存頁(yè)大小的簡(jiǎn)單方法
下面小編就為大家?guī)?lái)一篇linux查看文件系統(tǒng)塊大小與內(nèi)存頁(yè)大小的簡(jiǎn)單方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-11-11
虛擬機(jī)安裝linux系統(tǒng)無(wú)法上網(wǎng)的解決方法
這篇文章主要為大家詳細(xì)介紹了虛擬機(jī)安裝linux系統(tǒng)無(wú)法上網(wǎng)的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07
在Linux中查看所有正在運(yùn)行的進(jìn)程的方法
這篇文章主要介紹了在Linux中查看所有正在運(yùn)行的進(jìn)程的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-07-07
Linux服務(wù)器和docker時(shí)區(qū)修改問(wèn)題
這篇文章主要介紹了Linux服務(wù)器和docker時(shí)區(qū)修改問(wèn)題,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-06-06
linux下獲取當(dāng)前時(shí)間的相關(guān)函數(shù)
這篇文章主要介紹了linux下獲取當(dāng)前時(shí)間的相關(guān)函數(shù),具有很好的參考價(jià)值,希望對(duì)大家有所幫助,2023-09-09
Linux使用scp遠(yuǎn)程傳輸命令進(jìn)行服務(wù)器文件互傳(阿里云服務(wù)器)
因?yàn)橐慌_(tái)服務(wù)器linux服務(wù)器總是出問(wèn)題,也沒(méi)找到問(wèn)題只好重新配置環(huán)境,那么就需要文件備份操作,既然是linux服務(wù)器可以使用scp命令傳輸文件了2016-09-09

