新聞中心
代碼

創(chuàng)新互聯(lián)是一家專業(yè)提供淮陰企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、外貿(mào)營銷網(wǎng)站建設(shè)、HTML5建站、小程序制作等業(yè)務(wù)。10年已為淮陰眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站制作公司優(yōu)惠進(jìn)行中。
[root@Client root]# ssh-keygen -b 1024 -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:
49:9c:8a:8f:bc:19:5e:8c:c0:10:d3:15:60:a3:32:1c root@Client
[root@Client root]#
注意:在程序提示輸入passphrase時(shí)直接輸入回車,表示無證書密碼。
上述命令將生成私鑰證書id_rsa和公鑰證書id_rsa.pub,存放在用戶家目錄的.ssh子目錄中。
2. 將公鑰證書id_rsa.pub復(fù)制到機(jī)器Server的root家目錄的.ssh子目錄中,同時(shí)將文件名更換為authorized_keys。
代碼
[root@Client root]# scp -p .ssh/id_rsa.pub [email protected]:/root/.ssh/authorized_keys
[email protected]'s password: <-- 輸入機(jī)器Server的root用戶密碼
id_rsa.pub 100% |**************************| 218 00:00
[root@Client root]#
在執(zhí)行上述命令時(shí),兩臺(tái)機(jī)器的root用戶之間還未建立安全信任關(guān)系,所以還需要輸入機(jī)器Server的root用戶密碼。
經(jīng)過以上2步,就在機(jī)器Client的root和機(jī)器Server的root之間建立安全信任關(guān)系。下面我們看看效果:
[root@Client root]# scp -p text [email protected]:/root
text 100% |**************************| 19 00:00
[root@Client root]#
成功了!真的不再需要輸入密碼了。
分享標(biāo)題:scp設(shè)置不要求驗(yàn)證拷貝
本文地址:http://fisionsoft.com.cn/article/igeecc.html


咨詢
建站咨詢
