本文小编为大家详细介绍“如何使用Oracle的sshUserSetup.sh脚本配置SSH互信”,内容详细,步骤清晰,细节处理妥当,希望这篇“如何使用Oracle的sshUserSetup.sh脚本配置SSH互信”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

不管是在Oracle的GRID安装包,还是DB安装包里都有个脚本(sshUserSetup.sh),用于配置机器之间的SSH互信。配置互信,不仅仅在安装RAC需要配置。有时候我们需要配置ssh互信的时候,用这个脚本就很方便,不用敲那么命令了,直接用于脚本即可。

1 配置SSH

脚本大家都有,这里主要介绍用法。在脚本里,最上面有介绍用法:

UsagesshUserSetup.sh-user<username>[-hosts/"<spaceseparatedhostlist>/"|-hostfile<absolutepathofclusterconfigurationfile>][-advanced][-verify][-exverify][-logfile<desiredabsolutepathoflogfile>][-confirm][-shared][-help][-usePassphrase][-noPromptPassphrase]

如:

eg.sshUserSetup.sh-hosts"host1host2"-usernjerath-advanced

-hosts 表示:需要配置互信的服务器ip

-user 表示:用于远程登录到服务器上的用户名

-advanced 表示:hosts里的主机,每两个主机之间都是互信的。如果不加-advanced,例如:本机是HOST-A
在本机执行./sshUserSetup.sh -user aime -hosts A B C。那么就是HOST-A->A, HOST-A->B, HOST-A->C 的互信关系。A,B,C之间是不互信的。

注意:本地主机对远程主机的SSH互信,是单向的。不管加不加-advanced,如果A主机SSH 到主机HOST-A,那么还是要输入密码。如果想本地主机和远程之间SSH互信,那么把本地主机IP加入到host中即可。 -hosts “HOST-A host1 host2”

1.1 具体例子

这里用户都是root

1.2 本地主机ip

[root@localhostsshsetup]#ifconfigeth0Linkencap:EthernetHWaddr08:00:27:5C:99:99inetaddr:192.168.1.99Bcast:192.168.1.255Mask:255.255.255.01.2.1 本地主机向所有远程服务器互信,远程主机之间不互信

没有加 -advanced

[root@localhostsshsetup]#./sshUserSetup.sh-userroot-hosts'192.168.1.3192.168.1.4'Theoutputofthisscriptisalsologgedinto/tmp/sshUserSetup_2017-02-22-15-40-10.logHostsare192.168.1.3192.168.1.4userisrootPlatform:-LinuxCheckingiftheremotehostsarereachablePING192.168.1.3(192.168.1.3)56(84)bytesofdata.64bytesfrom192.168.1.3:icmp_seq=1ttl=64time=1.77ms64bytesfrom192.168.1.3:icmp_seq=2ttl=64time=1.03ms64bytesfrom192.168.1.3:icmp_seq=3ttl=64time=0.829ms64bytesfrom192.168.1.3:icmp_seq=4ttl=64time=1.13ms64bytesfrom192.168.1.3:icmp_seq=5ttl=64time=0.986ms---192.168.1.3pingstatistics---5packetstransmitted,5received,0%packetloss,time4007msrttmin/avg/max/mdev=0.829/1.149/1.770/0.325msPING192.168.1.4(192.168.1.4)56(84)bytesofdata.64bytesfrom192.168.1.4:icmp_seq=1ttl=64time=1.65ms64bytesfrom192.168.1.4:icmp_seq=2ttl=64time=0.760ms64bytesfrom192.168.1.4:icmp_seq=3ttl=64time=1.00ms64bytesfrom192.168.1.4:icmp_seq=4ttl=64time=0.967ms64bytesfrom192.168.1.4:icmp_seq=5ttl=64time=0.861ms---192.168.1.4pingstatistics---5packetstransmitted,5received,0%packetloss,time4008msrttmin/avg/max/mdev=0.760/1.049/1.659/0.317msRemotehostreachabilitychecksucceeded.Thefollowinghostsarereachable:192.168.1.3192.168.1.4.Thefollowinghostsarenotreachable:.Allhostsarereachable.Proceedingfurther...firsthost192.168.1.3numhosts2ThescriptwillsetupSSHconnectivityfromthehostlocalhost.localdomaintoalltheremotehosts.Afterthescriptisexecuted,theusercanuseSSHtoruncommandsontheremotehostsorcopyfilesbetweenthishostlocalhost.localdomainandtheremotehostswithoutbeingpromptedforpasswordsorconfirmations.NOTE1:Aspartofthesetupprocedure,thisscriptwillusesshandscptocopyfilesbetweenthelocalhostandtheremotehosts.Sincethescriptdoesnotstorepasswords,youmaybepromptedforthepasswordsduringtheexecutionofthescriptwheneversshorscpisinvoked.NOTE2:ASPERSSHREQUIREMENTS,THISSCRIPTWILLSECURETHEUSERHOMEDIRECTORYANDTHE.sshDIRECTORYBYREVOKINGGROUPANDWORLDWRITEPRIVILEGESTOTHESEdirectories.Doyouwanttocontinueandletthescriptmaketheabovementionedchanges(yes/no)?yesTheuserchoseyesPleasespecifyifyouwanttospecifyapassphrasefortheprivatekeythisscriptwillcreateforthelocalhost.PassphraseisusedtoencrypttheprivatekeyandmakesSSHmuchmoresecure.Type'yes'or'no'andthenpressenter.Incaseyoupress'yes',youwouldneedtoenterthepassphrasewheneverthescriptexecutessshorscp.noTheestimatednumberoftimestheuserwouldbepromptedforapassphraseis4.Inaddition,iftheprivate-publicfilesarealsonewlycreated,theuserwouldhavetospecifythepassphraseononeadditionaloccasion.Enter'yes'or'no'.yesTheuserchoseyesCreating.sshdirectoryonlocalhost,ifnotpresentalreadyCreatingauthorized_keysfileonlocalhostChangingpermissionsonauthorized_keysto644onlocalhostCreatingknown_hostsfileonlocalhostChangingpermissionsonknown_hoststo644onlocalhostCreatingconfigfileonlocalhostIfaconfigfileexistsalreadyat/root/.ssh/config,itwouldbebackedupto/root/.ssh/config.backup.Removingoldprivate/publickeysonlocalhostRunningSSHkeygenonlocalhostEnterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Generatingpublic/privatersakeypair.Youridentificationhasbeensavedin/root/.ssh/id_rsa.Yourpublickeyhasbeensavedin/root/.ssh/id_rsa.pub.Thekeyfingerprintis:38:1d:89:e5:3f:3e:4a:9d:1f:3f:e1:87:e7:41:a6:06root@localhost.localdomainThekey'srandomartimageis:+--[RSA1024]----+|.||+.||.+||oo||oSoEo||.oo.=||.=.++||..o.o++||...=.|+-----------------+Creating.sshdirectoryandsettingpermissionsonremotehost192.168.1.3THESCRIPTWOULDALSOBEREVOKINGWRITEPERMISSIONSFORgroupANDothersONTHEHOMEDIRECTORYFORroot.THISISANSSHREQUIREMENT.Thescriptwouldcreate~root/.ssh/configfileonremotehost192.168.1.3.Ifaconfigfileexistsalreadyat~root/.ssh/config,itwouldbebackedupto~root/.ssh/config.backup.TheusermaybepromptedforapasswordheresincethescriptwouldberunningSSHonhost192.168.1.3.Warning:Permanentlyadded'192.168.1.3'(RSA)tothelistofknownhosts.root@192.168.1.3'spassword:Donewithcreating.sshdirectoryandsettingpermissionsonremotehost192.168.1.3.Creating.sshdirectoryandsettingpermissionsonremotehost192.168.1.4THESCRIPTWOULDALSOBEREVOKINGWRITEPERMISSIONSFORgroupANDothersONTHEHOMEDIRECTORYFORroot.THISISANSSHREQUIREMENT.Thescriptwouldcreate~root/.ssh/configfileonremotehost192.168.1.4.Ifaconfigfileexistsalreadyat~root/.ssh/config,itwouldbebackedupto~root/.ssh/config.backup.TheusermaybepromptedforapasswordheresincethescriptwouldberunningSSHonhost192.168.1.4.Warning:Permanentlyadded'192.168.1.4'(RSA)tothelistofknownhosts.root@192.168.1.4'spassword:Donewithcreating.sshdirectoryandsettingpermissionsonremotehost192.168.1.4.Copyinglocalhostpublickeytotheremotehost192.168.1.3TheusermaybepromptedforapasswordorpassphraseheresincethescriptwouldbeusingSCPforhost192.168.1.3.root@192.168.1.3'spassword:--输入远程服务器对应用户的密码Donecopyinglocalhostpublickeytotheremotehost192.168.1.3Copyinglocalhostpublickeytotheremotehost192.168.1.4TheusermaybepromptedforapasswordorpassphraseheresincethescriptwouldbeusingSCPforhost192.168.1.4.root@192.168.1.4'spassword:Donecopyinglocalhostpublickeytotheremotehost192.168.1.4ThescriptwillrunSSHontheremotemachine192.168.1.3.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.ThescriptwillrunSSHontheremotemachine192.168.1.4.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.SSHsetupiscomplete.------------------------------------------------------------------------VerifyingSSHsetup===================Thescriptwillnowrunthedatecommandontheremotenodesusingsshtoverifyifsshissetupcorrectly.IFTHESETUPISCORRECTLYSETUP,THERESHOULDBENOOUTPUTOTHERTHANTHEDATEANDSSHSHOULDNOTASKFORPASSWORDS.Ifyouseeanyoutputotherthandateorarepromptedforthepassword,sshisnotsetupcorrectlyandyouwillneedtoresolvetheissueandsetupsshagain.Thepossiblecausesforfailurecouldbe:1.Theserversettingsin/etc/ssh/sshd_configfiledonotallowsshforuserroot.2.Theservermayhavedisabledpublickeybasedauthentication.3.Theclientpublickeyontheservermaybeoutdated.4.~rootor~root/.sshontheremotehostmaynotbeownedbyroot.5.Usermaynothavepassed-sharedoptionforsharedremoteusersormaybepassingthe-sharedoptionfornon-sharedremoteusers.6.Ifthereisoutputinadditiontothedate,butnopasswordisasked,itmaybeasecurityalertshownaspartofcompanypolicy.Appendtheadditionaltexttothe<OMSHOME>/sysman/prov/resources/ignoreMessages.txtfile.--------------------------------------------------------------------------192.168.1.3:--Running/usr/bin/ssh-x-lroot192.168.1.3datetoverifySSHconnectivityhasbeensetupfromlocalhostto192.168.1.3.IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.PleasenotethatbeingpromptedforapassphrasemaybeOKbutbeingpromptedforapasswordisERROR.ThescriptwillrunSSHontheremotemachine192.168.1.3.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.WedFeb2215:45:12CST2017--------------------------------------------------------------------------192.168.1.4:--Running/usr/bin/ssh-x-lroot192.168.1.4datetoverifySSHconnectivityhasbeensetupfromlocalhostto192.168.1.4.IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.PleasenotethatbeingpromptedforapassphrasemaybeOKbutbeingpromptedforapasswordisERROR.ThescriptwillrunSSHontheremotemachine192.168.1.4.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.WedFeb2215:48:02CST2017------------------------------------------------------------------------SSHverificationcomplete.1.2.2 验证1.2.2.1 本机对所有远程服务器单向SSH

[root@localhostsshsetup]#ifconfigeth0Linkencap:EthernetHWaddr08:00:27:5C:99:99inetaddr:192.168.1.99Bcast:192.168.1.255Mask:255.255.255.0[root@localhostsshsetup]#ssh192.168.1.3dateWedFeb2215:47:09CST2017[root@localhostsshsetup]#ssh192.168.1.4dateWedFeb2215:50:02CST20171.2.2.2 远程服务器之间验证

[root@web~]#ifconfigeth0Linkencap:EthernetHWaddr40:8D:5C:E5:AD:08inetaddr:192.168.1.4Bcast:192.168.1.255Mask:255.255.255.0[root@web~]#ssh192.168.1.3dateroot@192.168.1.3'spassword:

可以看到,需要输入密码。

1.3 配置所有远程主机之间的SSH互信

[root@localhostsshsetup]#./sshUserSetup.sh-userroot-hosts'192.168.1.3192.168.1.4'-advancedTheoutputofthisscriptisalsologgedinto/tmp/sshUserSetup_2017-02-22-15-46-13.logHostsare192.168.1.3192.168.1.4userisrootPlatform:-LinuxCheckingiftheremotehostsarereachablePING192.168.1.3(192.168.1.3)56(84)bytesofdata.64bytesfrom192.168.1.3:icmp_seq=1ttl=64time=0.858ms64bytesfrom192.168.1.3:icmp_seq=2ttl=64time=1.01ms64bytesfrom192.168.1.3:icmp_seq=3ttl=64time=0.945ms64bytesfrom192.168.1.3:icmp_seq=4ttl=64time=0.994ms64bytesfrom192.168.1.3:icmp_seq=5ttl=64time=0.948ms---192.168.1.3pingstatistics---5packetstransmitted,5received,0%packetloss,time4007msrttmin/avg/max/mdev=0.858/0.952/1.016/0.057msPING192.168.1.4(192.168.1.4)56(84)bytesofdata.64bytesfrom192.168.1.4:icmp_seq=1ttl=64time=0.823ms64bytesfrom192.168.1.4:icmp_seq=2ttl=64time=0.918ms64bytesfrom192.168.1.4:icmp_seq=3ttl=64time=1.02ms64bytesfrom192.168.1.4:icmp_seq=4ttl=64time=0.807ms64bytesfrom192.168.1.4:icmp_seq=5ttl=64time=1.01ms---192.168.1.4pingstatistics---5packetstransmitted,5received,0%packetloss,time4005msrttmin/avg/max/mdev=0.807/0.918/1.023/0.092msRemotehostreachabilitychecksucceeded.Thefollowinghostsarereachable:192.168.1.3192.168.1.4.Thefollowinghostsarenotreachable:.Allhostsarereachable.Proceedingfurther...firsthost192.168.1.3numhosts2ThescriptwillsetupSSHconnectivityfromthehostlocalhost.localdomaintoalltheremotehosts.Afterthescriptisexecuted,theusercanuseSSHtoruncommandsontheremotehostsorcopyfilesbetweenthishostlocalhost.localdomainandtheremotehostswithoutbeingpromptedforpasswordsorconfirmations.NOTE1:Aspartofthesetupprocedure,thisscriptwillusesshandscptocopyfilesbetweenthelocalhostandtheremotehosts.Sincethescriptdoesnotstorepasswords,youmaybepromptedforthepasswordsduringtheexecutionofthescriptwheneversshorscpisinvoked.NOTE2:ASPERSSHREQUIREMENTS,THISSCRIPTWILLSECURETHEUSERHOMEDIRECTORYANDTHE.sshDIRECTORYBYREVOKINGGROUPANDWORLDWRITEPRIVILEGESTOTHESEdirectories.Doyouwanttocontinueandletthescriptmaketheabovementionedchanges(yes/no)?yesTheuserchoseyesPleasespecifyifyouwanttospecifyapassphrasefortheprivatekeythisscriptwillcreateforthelocalhost.PassphraseisusedtoencrypttheprivatekeyandmakesSSHmuchmoresecure.Type'yes'or'no'andthenpressenter.Incaseyoupress'yes',youwouldneedtoenterthepassphrasewheneverthescriptexecutessshorscp.noTheestimatednumberoftimestheuserwouldbepromptedforapassphraseis4.Inaddition,iftheprivate-publicfilesarealsonewlycreated,theuserwouldhavetospecifythepassphraseononeadditionaloccasion.Enter'yes'or'no'.yesTheuserchoseyesThefilescontainingtheclientpublicandprivatekeysalreadyexistonthelocalhost.Thecurrentprivatekeymayormaynothaveapassphraseassociatedwithit.Incaseyourememberthepassphraseanddonotwanttore-runssh-keygen,press'no'andenter.Ifyoupress'no',thescriptwillnotattempttocreateanynewpublic/privatekeypairs.Ifyoupress'yes',thescriptwillremovetheoldprivate/publickeyfilesexistingandcreatenewonespromptingtheusertoenterthepassphrase.Ifyouenter'yes',anypreviousSSHusersetupswouldbereset.Ifyoupress'change',thescriptwillassociateanewpassphrasewiththeoldkeys.Press'yes','no'or'change'yesTheuserchoseyesCreating.sshdirectoryonlocalhost,ifnotpresentalreadyCreatingauthorized_keysfileonlocalhostChangingpermissionsonauthorized_keysto644onlocalhostCreatingknown_hostsfileonlocalhostChangingpermissionsonknown_hoststo644onlocalhostCreatingconfigfileonlocalhostIfaconfigfileexistsalreadyat/root/.ssh/config,itwouldbebackedupto/root/.ssh/config.backup.Removingoldprivate/publickeysonlocalhostRunningSSHkeygenonlocalhostEnterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Generatingpublic/privatersakeypair.Youridentificationhasbeensavedin/root/.ssh/id_rsa.Yourpublickeyhasbeensavedin/root/.ssh/id_rsa.pub.Thekeyfingerprintis:f5:fd:97:37:c6:83:50:a3:31:d0:f6:94:45:33:50:e8root@localhost.localdomainThekey'srandomartimageis:+--[RSA1024]----+|...B*||.o+o||oo+o||..=E.||So..||.o..||.*+||.=|||+-----------------+Creating.sshdirectoryandsettingpermissionsonremotehost192.168.1.3THESCRIPTWOULDALSOBEREVOKINGWRITEPERMISSIONSFORgroupANDothersONTHEHOMEDIRECTORYFORroot.THISISANSSHREQUIREMENT.Thescriptwouldcreate~root/.ssh/configfileonremotehost192.168.1.3.Ifaconfigfileexistsalreadyat~root/.ssh/config,itwouldbebackedupto~root/.ssh/config.backup.TheusermaybepromptedforapasswordheresincethescriptwouldberunningSSHonhost192.168.1.3.Warning:Permanentlyadded'192.168.1.3'(RSA)tothelistofknownhosts.root@192.168.1.3'spassword:Donewithcreating.sshdirectoryandsettingpermissionsonremotehost192.168.1.3.Creating.sshdirectoryandsettingpermissionsonremotehost192.168.1.4THESCRIPTWOULDALSOBEREVOKINGWRITEPERMISSIONSFORgroupANDothersONTHEHOMEDIRECTORYFORroot.THISISANSSHREQUIREMENT.Thescriptwouldcreate~root/.ssh/configfileonremotehost192.168.1.4.Ifaconfigfileexistsalreadyat~root/.ssh/config,itwouldbebackedupto~root/.ssh/config.backup.TheusermaybepromptedforapasswordheresincethescriptwouldberunningSSHonhost192.168.1.4.Warning:Permanentlyadded'192.168.1.4'(RSA)tothelistofknownhosts.root@192.168.1.4'spassword:Donewithcreating.sshdirectoryandsettingpermissionsonremotehost192.168.1.4.Copyinglocalhostpublickeytotheremotehost192.168.1.3TheusermaybepromptedforapasswordorpassphraseheresincethescriptwouldbeusingSCPforhost192.168.1.3.root@192.168.1.3'spassword:Donecopyinglocalhostpublickeytotheremotehost192.168.1.3Copyinglocalhostpublickeytotheremotehost192.168.1.4TheusermaybepromptedforapasswordorpassphraseheresincethescriptwouldbeusingSCPforhost192.168.1.4.root@192.168.1.4'spassword:Donecopyinglocalhostpublickeytotheremotehost192.168.1.4Creatingkeysonremotehost192.168.1.3iftheydonotexistalready.ThisisrequiredtosetupSSHonhost192.168.1.3.Creatingkeysonremotehost192.168.1.4iftheydonotexistalready.ThisisrequiredtosetupSSHonhost192.168.1.4.Generatingpublic/privatersakeypair.Youridentificationhasbeensavedin.ssh/id_rsa.Yourpublickeyhasbeensavedin.ssh/id_rsa.pub.Thekeyfingerprintis:88:b1:d4:49:1e:df:ea:f5:d6:c9:27:a4:a1:8b:6c:c4root@webThekey'srandomartimageis:+--[RSA1024]----+|o||++.||o+..||.+..||o..S...||.E.o*.||...+=.||...oo||.o.|+-----------------+Updatingauthorized_keysfileonremotehost192.168.1.3Updatingknown_hostsfileonremotehost192.168.1.3ThescriptwillrunSSHontheremotemachine192.168.1.3.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.Updatingauthorized_keysfileonremotehost192.168.1.4Updatingknown_hostsfileonremotehost192.168.1.4ThescriptwillrunSSHontheremotemachine192.168.1.4.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.SSHsetupiscomplete.------------------------------------------------------------------------VerifyingSSHsetup===================Thescriptwillnowrunthedatecommandontheremotenodesusingsshtoverifyifsshissetupcorrectly.IFTHESETUPISCORRECTLYSETUP,THERESHOULDBENOOUTPUTOTHERTHANTHEDATEANDSSHSHOULDNOTASKFORPASSWORDS.Ifyouseeanyoutputotherthandateorarepromptedforthepassword,sshisnotsetupcorrectlyandyouwillneedtoresolvetheissueandsetupsshagain.Thepossiblecausesforfailurecouldbe:1.Theserversettingsin/etc/ssh/sshd_configfiledonotallowsshforuserroot.2.Theservermayhavedisabledpublickeybasedauthentication.3.Theclientpublickeyontheservermaybeoutdated.4.~rootor~root/.sshontheremotehostmaynotbeownedbyroot.5.Usermaynothavepassed-sharedoptionforsharedremoteusersormaybepassingthe-sharedoptionfornon-sharedremoteusers.6.Ifthereisoutputinadditiontothedate,butnopasswordisasked,itmaybeasecurityalertshownaspartofcompanypolicy.Appendtheadditionaltexttothe<OMSHOME>/sysman/prov/resources/ignoreMessages.txtfile.--------------------------------------------------------------------------192.168.1.3:--Running/usr/bin/ssh-x-lroot192.168.1.3datetoverifySSHconnectivityhasbeensetupfromlocalhostto192.168.1.3.IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.PleasenotethatbeingpromptedforapassphrasemaybeOKbutbeingpromptedforapasswordisERROR.ThescriptwillrunSSHontheremotemachine192.168.1.3.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.WedFeb2215:50:58CST2017--------------------------------------------------------------------------192.168.1.4:--Running/usr/bin/ssh-x-lroot192.168.1.4datetoverifySSHconnectivityhasbeensetupfromlocalhostto192.168.1.4.IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.PleasenotethatbeingpromptedforapassphrasemaybeOKbutbeingpromptedforapasswordisERROR.ThescriptwillrunSSHontheremotemachine192.168.1.4.Theusermaybepromptedforapassphrasehereincasetheprivatekeyhasbeenencryptedwithapassphrase.WedFeb2215:53:48CST2017------------------------------------------------------------------------------------------------------------------------------------------------VerifyingSSHconnectivityhasbeensetupfrom192.168.1.3to192.168.1.3IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.WedFeb2215:50:59CST2017------------------------------------------------------------------------------------------------------------------------------------------------VerifyingSSHconnectivityhasbeensetupfrom192.168.1.3to192.168.1.4IFYOUSEEANYOTHEROUTPUTBESIDESTHEOUTPUTOFTHEDATECOMMANDORIFYOUAREPROMPTEDFORAPASSWORDHERE,ITMEANSSSHSETUPHASNOTBEENSUCCESSFUL.WedFeb2215:53:49CST2017-------------------------------------------------------------------------Verificationfromcomplete-SSHverificationcomplete.1.3.1 验证1.3.1.1 本机向远程主机SSH

[root@localhostsshsetup]#ifconfigeth0Linkencap:EthernetHWaddr08:00:27:5C:99:99inetaddr:192.168.1.99Bcast:192.168.1.255Mask:255.255.255.0[root@localhostsshsetup]#ssh192.168.1.4dateWedFeb2215:54:37CST2017[root@localhostsshsetup]#ssh192.168.1.3dateWedFeb2215:51:51CST20171.3.1.2 远程主机之间SSH互信

主机192.168.1.4

[root@web~]#ifconfigeth0Linkencap:EthernetHWaddr40:8D:5C:E5:AD:08inetaddr:192.168.1.4Bcast:192.168.1.255Mask:255.255.255.[root@web~]#ssh192.168.1.3date2017年02月22日星期三15:52:32CST

主机192.168.1.3

[root@dg2~]#ifconfigeth0Linkencap:EthernetHWaddr40:8D:5C:E4:69:4Binetaddr:192.168.1.3Bcast:192.168.1.255Mask:255.255.255.0[root@dg2~]#ssh192.168.1.4dateWedFeb2216:01:49CST2017

读到这里,这篇“如何使用Oracle的sshUserSetup.sh脚本配置SSH互信”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注亿速云行业资讯频道。