劉道軍,劉道軍講師,劉道軍聯(lián)系方式,劉道軍培訓(xùn)師-【中華講師網(wǎng)】
45
鮮花排名
0
鮮花數(shù)量
劉道軍:實(shí)驗(yàn):了解 HASH 算法的工作原理以及 md5sum 程序的使用
2016-01-20 42160
實(shí)驗(yàn):了解 HASH 算法的工作原理以及 md5sum 程序的使用 實(shí)驗(yàn)步驟:1、以 root 身份登錄到 linux 系統(tǒng)2、在根目錄下創(chuàng)建文件夾 md5testcd/mkdir md5test3、進(jìn)入 md5test 目錄:cd md5test4、創(chuàng)建名為 myfile 的文件:touch myfile5、使用 vi 編輯 myfile 文件,輸入以下內(nèi)容:Has anyone altered the contents of this file?6、使用 md5sum 計(jì)算 hash 校驗(yàn)和[root@md5test]#md5sum myfile7、再次運(yùn)行 md5sum 命令,并且將結(jié)果導(dǎo)出保存到 myfile.md5 文件中[root@md5test]md5sum myfile>myfile.md58、打開 myfile 文件,修改文件內(nèi)容(盡量作最小的改動(dòng))然后保存9、再次運(yùn)行 md5sum 命令,應(yīng)該得到以不同的 hash 值10、用 cat 命令查看 myfile.md5 內(nèi)容:cat myfile.md511、比較第 9 步和第 10 步的輸出結(jié)果,應(yīng)該看到兩者的不同12、輸入以下命令:md5sum/etc/passwd/>passwd.md5,創(chuàng)建針對(duì)當(dāng)前/etc/passwd數(shù)據(jù)庫(kù)的 hash 校驗(yàn)和13、查看 passwd.md5 文件內(nèi)容:cat passwd.md514、添加用戶 hashtest 并且修改密碼Linux#useradd hashtestLinux#passwd hashtestChanging password for user hashtestNes UNIX password:Retype new UNIX password:passwd:all authentication tokens updated successfully15、執(zhí)行命令 md5sum-c passwd.md5,其中-c 參數(shù)用來(lái)比較數(shù)據(jù)庫(kù)更改前后的 hash應(yīng)該能夠看到有關(guān)校驗(yàn)值已經(jīng)改變的信息
全部評(píng)論 (0)

Copyright©2008-2025 版權(quán)所有 浙ICP備06026258號(hào)-1 浙公網(wǎng)安備 33010802003509號(hào) 杭州講師網(wǎng)絡(luò)科技有限公司
講師網(wǎng) www.3969a.com 直接對(duì)接10000多名優(yōu)秀講師-省時(shí)省力省錢
講師網(wǎng)常年法律顧問(wèn):浙江麥迪律師事務(wù)所 梁俊景律師 李小平律師