scp設(shè)置不要求驗(yàn)證拷貝

代碼

創(chuàng)新互聯(lián)是一家專業(yè)提供淮陰企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、外貿(mào)營(yíng)銷網(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 root@192.168.3.206:/root/.ssh/authorized_keys

root@192.168.3.206'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 root@192.168.3.206:/root

        text                 100% |**************************|    19       00:00

[root@Client root]# 

    成功了!真的不再需要輸入密碼了。

文章題目:scp設(shè)置不要求驗(yàn)證拷貝
當(dāng)前路徑:http://bm7419.com/article22/igeecc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、Google、App開發(fā)、網(wǎng)站收錄、標(biāo)簽優(yōu)化App設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司