網(wǎng)絡(luò)配置與遠(yuǎn)程管理SSH_第1頁(yè)
網(wǎng)絡(luò)配置與遠(yuǎn)程管理SSH_第2頁(yè)
網(wǎng)絡(luò)配置與遠(yuǎn)程管理SSH_第3頁(yè)
網(wǎng)絡(luò)配置與遠(yuǎn)程管理SSH_第4頁(yè)
網(wǎng)絡(luò)配置與遠(yuǎn)程管理SSH_第5頁(yè)
已閱讀5頁(yè),還剩4頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、網(wǎng)絡(luò)配置與遠(yuǎn)程管理(二)一、實(shí)訓(xùn)目的1. 能夠配置網(wǎng)卡參數(shù);2. 能夠正確啟動(dòng)、重啟及停止網(wǎng)絡(luò)服務(wù);3. 能夠?qū)W(wǎng)絡(luò)常見(jiàn)故障進(jìn)行排除;4. 能夠使用SSH進(jìn)行遠(yuǎn)程管理二、實(shí)訓(xùn)工具與設(shè)備1. 實(shí)訓(xùn)工具CentOS6 ISO 鏡像 CentOS-6.6-x86_64-bin-DVD1.iso、Oracle VM VirtualBox2. 實(shí)訓(xùn)設(shè)備CPU i3 及以上,內(nèi)存 4GB及以上,硬盤(pán) 500G及以上。歡迎進(jìn)入代碼族:www.codezu.c n更多資料加群811472852 (資料都是各大論壇找到的)三、實(shí)訓(xùn)內(nèi)容1、SSH實(shí)現(xiàn)遠(yuǎn)程管理四、操作步驟:日期(節(jié)次):班級(jí):學(xué)號(hào):姓名:1、網(wǎng)絡(luò)配

2、置:(1)在 Windows 中,啟用VirtualBox Host-Only Network,并查看VirtualBoxHost- Only Network ” 的網(wǎng)絡(luò)參數(shù);(2) 打開(kāi) VirtualBox ,選擇已經(jīng)女裝好的CentOS6.6,點(diǎn)擊 設(shè)置網(wǎng)絡(luò)“連接方式”一一“僅主機(jī)(Host-Only )網(wǎng)絡(luò)”;在“存儲(chǔ)”中配置好光盤(pán)介質(zhì),并且在“系統(tǒng)”中配置好硬盤(pán)的啟動(dòng)順序;點(diǎn)擊“確定”按鈕,保存參數(shù)設(shè)置。(3) 在“ VirtualBox ”中,選中Cen tOS 6.6,點(diǎn)擊“備份系統(tǒng)快照”,在窗口中點(diǎn)擊“復(fù)制所選的虛擬機(jī)”,按照向?qū)崾?,?fù)制一個(gè)CentOS 6.6畐U本。(4)

3、啟動(dòng)“ CentOS 6.6 ”,修改 /etc/sysconfig/network-scripts/ifcfg-ethO文檔,編輯并修改如下參數(shù):ONBOOT BOOTPROTOPADDR NETMASK GATEWA丫重啟網(wǎng)卡;(5)啟動(dòng)“ CentOS 6.6 副本”,查看eth1網(wǎng)卡的 MAC地址# cat /etc/udev/rules.d/70-persiste nt-n et.rules(6) 修改 /etc/sysconfig/network-scripts/ifcfg-ethO文檔DEVICE=eth1HWADDR=/這里填寫(xiě)的是(5)中查到的eth1的MAC地址另外,還需設(shè)

4、置 ONBOOT BOOTPROTOPADDR NETMASK GATEWAY 重啟 network。(7)用ping命令測(cè)試兩臺(tái)Linux之間的連通情況。root? localliost Jfl p ing 19Z . 168.56.2PING 192.16B.56.Z () 56(84bytes bufte?bytes bytesfrom from Prom Prom fromicmp seiq = l icmp seq=2 icmp_scq=3 icmp_seq=1 icmp_£eq=5)bytes 1=64 tt 1=64 ttl訕 ttl=64 tt

5、l=64of da±a.time-3.B9 ns吐4 mst i mc = l.15 ms t ime = l.30 mst imt!=0.86B ms-192.l&U.56.2 ping statistics packets trnsmiited j 5 received, Qy packet loss, t ime 4Z15ms ttxzmdeu = 0.968/1.6003 +091/6,762 hisrrootG 1 oca Host 1 It2、基于用戶名密碼的登錄方式(參考資料:教材、實(shí)驗(yàn)指導(dǎo)) 服務(wù)器端操作:(1) 查看sshd服務(wù)是否安裝# rpm - qa

6、| grep ssh(2) 啟動(dòng)sshd服務(wù)# service sshd restart(3) 創(chuàng)建一個(gè)普通用戶user,并為其設(shè)置密碼; 客戶端操作:用user用戶登錄sshd服務(wù)器;# ssh user192.168.56.*/輸入yes確認(rèn)連接/輸入user用戶的密碼歡迎進(jìn)入代碼族:www.codezu.c n更多資料加群811472852 (資料都是各大論壇找到的) 登錄成功。3、基于公鑰的SSH登錄(參考資料:教材、實(shí)驗(yàn)指導(dǎo)) 客戶端操作:接前面的實(shí)驗(yàn):$ exit /退出之前的連接(1) 創(chuàng)建公鑰文檔# ssh-keygen- t rsa/直接按回車(chē)鍵(2) 查看密鑰文檔是否創(chuàng)建成

7、功# cd .ssh# lsid_rsa id_rsa.pub known _hosts(3) 將公鑰文檔傳送到服務(wù)器端的/root目錄下# scp id_rsa.pub root192.168.56.*:/root/輸入服務(wù)器端root用戶的密碼/在服務(wù)器端查看/root下公鑰文件是否傳送成功服務(wù)器端操作:為了與客戶端的主機(jī)名區(qū)分開(kāi),修改本機(jī)主機(jī)名為linux ;# host name linux(1) 將公鑰文件追加到authorized.keys文件中;# mkdir .ssh# cat id_rsa.pub >> .ssh/authorized_keys(2) 修改auth

8、orized.keys 文件的權(quán)限;# chmod 600 .ssh /authorized_keys(3) 在SSH服務(wù)器上啟用公鑰認(rèn)證:# vim /etc/ssh/sshd_c onfig/關(guān)注以下內(nèi)容的參數(shù)修改RSAAuthe ntication yesPubkeyAuthe nticati on yesAuthorizedkeysFiles .ssh/authorized_keys Password Authe nticati on no:wq!# service sshd restart(4) 關(guān)閉selinux 防火墻:# sete nforce 0客戶端操作root登錄sshd

9、服務(wù)器# ssh root192.168.56.*/無(wú)需密碼,登錄成功。五、執(zhí)行結(jié)果:1、基于用戶名密碼的登錄方式將執(zhí)行結(jié)果以截圖的方式記錄下來(lái)。IrootOlocalhost "Jfl rpm -qa I grep ssh penssh-5.3p1-104.e16.i686pemssh-clients-5.3pl-104.e16.i68b1 ibssJiZ-1.-1,2-1.e 16. i&B6openssh-server-5.3pl-10.clb.i696 LrootPlocalhost J#1、23root 1 oca 1 hast lit service sslid

10、restart Stopp Ing sshd:StRrliny sshd:OK OK rroo 1# useradd user frootOlocalliost 1# passud user Chang ing passuord for user user, Meu passuord:BAD PASSWORD: it is too s imp 11st iczsystemat icRetype neu jjassuord :Sorry j passuords do not match.Neu passuord:BAD FASSUORD : it is too s imp 1 lsl iczst

11、sfemat lc 陞D PASSUOHD: is too sinplcRetype neu passuord:passud : a 11 c*uthent icat iom tokens updated successf u 1 ly . rootOloclhost Jttroot(? 1 oca 1 host - JI ssh user(?132.16B . 56.2The authent i c itij of host * 192.16B .56.2 ()f can * t be estab 1 RSA key f ingerprint is cb:lc:9e:

12、bb:6c::c3:6e:e5:ef:de:77:af:a3:£b:al Ar*e you sure you uan± to can't 1 nue connec't ing C yeszna J 7 LiesMamlng: Permanently added 1* (ESA) to the list of knouin h iiserP192 x 168.5& . 2J s passuord:LuserG lloca IBdst 1S _/TX Ellr-=ArlfZlrsi2、基于公鑰的SSH登錄 將執(zhí)行結(jié)果以截圖的方式記

13、錄下來(lái)。1 、Lonnecxion to 1£:. lbti, bb .i; closed.rootQ 1 oca lhost It ssh-keygen -t rs&Generatingr publ ic/private rs* key pa ir .Enter f ile in uhich to save the key (/root/.ssh/id_rse):Enter passphrase (empty for no passphrase):Eli lei- amc passphm占u aga. i n :Your i dent if i cat ion has be

14、en saved in /rootz . ssh/ iid_rsa .Your pub 1 ic k巳q has been sated in zrootz .ssFz id_rsa . pub .The keL| f ingErprint is :lb : If :6d ' f c :07 :51 : b7:7d : 3a : a8 :41 :14 :95 : 15 : ?c :c3 root!?locaIhost. loc« Ida The kuy'w rondomar七 imae is:k-T RSA Z01Q*i*+ + *;i.E.;S 0 . * D ; ,

15、*. . O I-ao . . . i .o i oo . IrootGlacalhast IttrootG l oca lliost*«cd .3:ihrootl? local ho st,sstiIff Isi d rsa i d_rsa.pubknourhostsrootUlocalhost.ssh tt2、3IrGtlo匚cilhci罵t vssht 墓匚卩 id rca . pub roatQ lZ . 168 -56 . Z :/root root91_5Z 168 £&£ s jpassword :i 打 _FEai pub : Nm suc

16、h file or A L rectoryEMKB 西03:38嚴(yán)口口七H Joca J Jiast ,ssh Jit scp id_rsa . pub root U lJZ16H 亠5E> - Z -/rnot rootylyZ IbHhb.2* s password:id_jr5a pubErootS1 locnJio3t .ssliJtt同急占J zfi 0 0 :il t«i n; c+k-irootGlocalhost "U Itostnrne 1 inux LrootlocaLhost m hostrneme1 1 mixirrIroat local ho

17、st ltt4、root® loc<i 1 host fl mkd ir . sshroot® localhost lit cat id_rsa .jiiib >> ,ssh/autlorized_keysrootGIocalhost * 14rrXrrrrootG local host "" Itt climod 606 sshzciu r-aotQ localhost )tt5、6、7nSTTOi on noroot®1acalhast Stopping sshd:rU> ir A Jrg XxJWBa J 7U 7 JWfl 1

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論