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