Linux

md5sum (파일 체크섬)

행복한하루 2008. 3. 25. 23:26
공개된 응용 프로그램들을 다운로드 받을때 보면 .md5라는 파일이 있는 경우가 있습니다. (주로 Open Source 프로그램들이 많이 이용하고 있습니다. ^^)
 
이미 아시는 분들은 아시겠지만, 이 파일은 다운 로드 받은 파일이 정상인지 아닌지를 판단하기 위하여 사용되는데, 리눅스에서는 md5sum 라는 프로그램을 이용합니다.

md5sum이라는 프로그램을 이용하여 다운 로드 받은 파일을 검사하면 checksum 값이 나오는데, 이를 같이 다운받은 .md5와 비교하여 같으면 정상으로 보고, 만약 같지 않으면 해당 파일이 변경되었다고 판단하여 해당 파일을 사용하지 않습니다.

예를 들어 파일질라 클라이언트 (FileZilla Client) 프로그램들을 다운로드 받는다고 가정하면 아래 그림과 같이 프로그램들과 같이 FileZilla_3.0.8.1.md5 라는 파일이 있는 것을 보실 수 있습니다.

(해당 파일 리스트는 http://sourceforge.net/projects/filezilla/ 에서 보실 수 있습니다.)

(윈도우용 FileZilla Clinet소개는 http://myknowledge.kr/48 을 참고 하시고, 파일질라 서버는 http://myknowledge.kr/49 를 참조 하시기 바랍니다.)

사용자 삽입 이미지

FileZilla client lists


먼저 리눅스용 FileZilla client인 FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2FileZilla_3.0.8.1.md5를 다운받습니다.

그리고 "md5sum -c FileZilla_3.0.8.1.md5" 명령을 이용하면 아래와 같이 결과가 나옵니다. 첫줄에 보시면

   FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2: OK

이렇게 나와 있습니다. 해당 파일이 정상이라는 의미입니다.

그 아래줄부터 나오는 "No such file or directory"라고 나오는 것은 나머지 파일들을 다운 로드 받지 않았기 때문에 나오는 것입니다. 저희가 필요한 파일은 FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2 이므로 나머지 에러는 무시하시면 됩니다.


$ md5sum -c FileZilla_3.0.8.1.md5
FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2: OK
md5sum: FileZilla_3.0.8.1_i686-apple-darwin9.app.tar.bz2: No such file or directory
FileZilla_3.0.8.1_i686-apple-darwin9.app.tar.bz2: FAILED open or read
md5sum: FileZilla_3.0.8.1_powerpc-apple-darwin9.app.tar.bz2: No such file or directory
FileZilla_3.0.8.1_powerpc-apple-darwin9.app.tar.bz2: FAILED open or read
md5sum: FileZilla_3.0.8.1_src.tar.bz2: No such file or directory
FileZilla_3.0.8.1_src.tar.bz2: FAILED open or read
md5sum: FileZilla_3.0.8.1_win32-setup.exe: No such file or directory
FileZilla_3.0.8.1_win32-setup.exe: FAILED open or read
md5sum: FileZilla_3.0.8.1_win32.zip: No such file or directory
FileZilla_3.0.8.1_win32.zip: FAILED open or read
md5sum: FileZilla_3.0.8.1_x86_64-linux-gnu.tar.bz2: No such file or directory
FileZilla_3.0.8.1_x86_64-linux-gnu.tar.bz2: FAILED open or read
md5sum: WARNING: 6 of 7 listed files could not be read
$


아니면 아래와 같이 "md5sum filename" 을 입력하면 checksum 값이 출력됩니다. 이를 FileZilla_3.0.8.1.md5 파일 안에 있는 값이랑 직접 비교해 보셔도 됩니다.
(FileZilla_3.0.8.1.md5 파일은 텍스트 형태 이므로 vi로 열어서 직접 볼 수 있습니다. )


$ md5sum FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2
a1a0153dbd2fef8018b3d4a731dfe5e9  FileZilla_3.0.8.1_i586-linux-gnu.tar.bz2
$


이렇게 해서 md5sum을 이용하여 다운로드 받은 파일을 확인하는 방법에 대하여 알아 봤습니다.

요세는 md5sum을 잘 안쓰는 분위기 이긴 하지만 혹시 필요하신 분들을 위해 간단하게 적어 보았습니다.


'Linux' 카테고리의 다른 글

VirtualBox Fedora9 화면해상도 변경  (1) 2008.09.09
Fedora9 Flash Player 설치  (1) 2008.08.29
VNC with SSH  (0) 2008.03.03
MySQL Error : Client does not support authentication protocol  (0) 2008.02.19
VNC 화면 공유하기  (0) 2007.12.22