강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

보안쉘(SSH) 설치 및 운영

작성자 정보

  • 웹관리자 작성
  • 작성일

컨텐츠 정보

본문

icon01.giftitle22.gif


icon04.gif1. 보안쉘이란?

인터넷이란 네트웍에서는 수많은 데이타들이 흘러다니며 이런 데이터들속에는 중요한 정보(예를들어, ID와 패스워드등)들이 포함되어 있습니다.

네트웍상에서는 이런 정보들을 스니핑(Sniffing)도구를 이용하여 훔쳐볼수도 있습니다.

보안쉘(Secure Shell)이란 이런 데이터(패킷)들을 주고받을때 특수한 알고리즘(예, BlowFish, Triple DES, IDEA, RSA등)을 이용하여 데이터를 주고받는 방법으로 데이터를 스니핑(Sniffing)하여 훔쳐보더라도 전혀 알수없게 됩니다.

ssh는 tcp 포트 22번을 사용하게 됩니다.

여기서는 최신버전인 ssh 2.4.0을 기준으로 설명되며, ssh2로 보안쉘이 작동하게 됩니다.

 

icon04.gif2. 보안쉘(SSH) 데몬설치 프로그램

http://www.ssh.fi

여기에서 가장 가까운 Mirror Site에서 다운받으면 됩니다.

필자가 다운받은 파일ssh-2.4.0.tar.gz으로 현재 최신버전입니다.

 

icon04.gif3. SSH를 실제 한 시스템사양(필자의 시스템)

설치사양

OS : Redhat Linux 6.2

CPU : Pentium 800Mhz

RAM : 256MB

HDD : SCSI 9.1GB

 

icon04.gif4. SSH설치 순서개괄

1단계 : ssh프로그램을 다운로드한다.(다운로드후 설치할 서버로 전송한다.)

2단계 : 압축을 해제한다.(gzip, tar등)

3단계 : configure를 수행한다.

Makefile을 생성하며, 부가적으로 ssh를 컴파일하기위한 파일들을 생성한다.

4단계 : make

실제 컴파일을 수행한다. (수행후에는 아래와 같은 파일들이 생성된다.)

scp2, ssh2, sshd2, ssh-add, ssh-agent, ssh-keygen

5단계 : make install을 수행한다.

이 작업은 sshd2라는 데몬과 관련 파일들을 적당한 디렉토리에 복사하고 퍼미션을 설정한다.

6단계 : sshd2 데몬을 실행한다.

7단계 : 보안쉘로그인을 테스트한다.

 

icon04.gif5. 보안쉘(SSH) 설정파일들

[root@fashionimport sbin]# cd /etc/ssh2
root@fashionimport ssh2]# ll
합계 24
-rw------- 1 root root 828 3월 10 08:21 hostkey
-rw-r--r-- 1 root root 697 3월 10 08:21 hostkey.pub
-rw------- 1 root root 512 3월 10 08:46 random_seed
-rw-r--r-- 1 root root 1736 3월 10 08:21 ssh2_config
-rw-r--r-- 1 root root 122 3월 10 08:21 ssh_dummy_shell.out
-rw-r--r-- 1 root root 2582 3월 10 08:21 sshd2_config
[root@fashionimport ssh2]#

sshd2_config : ssh 서버설정파일

ssh2_config : ssh 클라이언트 설정파일



icon04.gif 6. 실제설치 예<?XML:NAMESPACE PREFIX = O />

_1

 

Red Hat Linux release 6.2 (Zoot)

Kernel 2.2.16-3smp on an i686

login: sskim

Password:

Last login: Sat Mar 10 07:30:28 from 211.220.193.149

[sskim@fashionimport sskim]$ su -

Password:

[root@fashionimport /root]#

[root@fashionimport /root]#

[root@fashionimport /root]#

[root@fashionimport /root]# cd /home/sskim

[root@fashionimport sskim]#

[root@fashionimport sskim]# ll

합계 3624

-rw-r--r--    1 sskim    sskim     1911375  3월 10 07:43 ssh-2.4.0.tar.gz

[root@fashionimport sskim]#

[root@fashionimport sskim]#

[root@fashionimport sskim]#

[root@fashionimport sskim]# tar xvfpz ssh-2.4.0.tar.gz

ssh-2.4.0/

ssh-2.4.0/include/

ssh-2.4.0/include/Makefile.am

ssh-2.4.0/include/Makefile.in


..................
root@fashionimport sskim]# cd ssh-2.4.0

[root@fashionimport ssh-2.4.0]#

[root@fashionimport ssh-2.4.0]# ./configure

creating cache ./config.cache

checking distribution consistency... done

checking host system type... i686-pc-linux-gnu

checking target system type... i686-pc-linux-gnu

checking build system type... i686-pc-linux-gnu

.............

[root@fashionimport ssh-2.4.0]# make

make  all-recursive

make[1]: Entering directory `/home/sskim/ssh-2.4.0'

Making all in lib
...........

[root@fashionimport ssh-2.4.0]#

[root@fashionimport ssh-2.4.0]# make install

(cd apps/ssh; make install)

make[1]: Entering directory `/home/sskim/ssh-2.4.0/apps/ssh'

Making install in tests


.....................

[root@fashionimport sbin]# sshd

sshd: SSH Secure Shell 2.4.0 (non-commercial version) on i686-pc-linux-gnu

[root@fashionimport sbin]#

[root@fashionimport sbin]# ps -ef | grep sshd

root     21180     1  0 08:30 ?        00:00:00 sshd

root     21182 13540  0 08:30 pts/1    00:00:00 grep sshd

[root@fashionimport sbin]#



icon04.gif 7. ssh로 안전한 접속하기 

 

[root@fashionimport sbin]# ssh -l sskim  211.220.193.187

Host key not found from database.

Key fingerprint:

xedir-dugiz-kakum-segic-rugub-minuf-ketif-citum-lybop-mudih-ruxex

You can get a public key's fingerprint by running

% ssh-keygen -F publickey.pub

on the keyfile.

Are you sure you want to continue connecting (yes/no)? yes

Host key saved to /root/.ssh2/hostkeys/key_22_211.220.193.187.pub

host key for 211.220.193.187, accepted by root Sat Mar 10 2001 08:31:25 +0900

sskim's password:

Authentication successful.

Last login: Sat Mar 10 2001 08:15:42 +0900 from 211.220.193.149

No mail.

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$ exit

logout

 

Connection to 211.220.193.187 closed.

[root@fashionimport sbin]# ssh -l sskim localhost

Host key not found from database.

Key fingerprint:

xedir-dugiz-kakum-segic-rugub-minuf-ketif-citum-lybop-mudih-ruxex

You can get a public key's fingerprint by running

% ssh-keygen -F publickey.pub

on the keyfile.

Are you sure you want to continue connecting (yes/no)? yes

Host key saved to /root/.ssh2/hostkeys/key_22_localhost.pub

host key for localhost, accepted by root Sat Mar 10 2001 08:33:21 +0900

sskim's password:

Authentication successful.

Last login: Sat Mar 10 2001 08:32:31 +0900 from 211.220.193.149

No mail.

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$

[sskim@fashionimport sskim]$ exit

logout

icon04.gif 8 . ssh의 간단한 사용예

 

        [root@hlxsvr ssh]# ssh -l sspark nicekorea.co.kr ls -l
        The authenticity of host 'nicekorea.co.kr' can't be established.
        Key fingerprint is 1024 3b:46:c5:06:b5:47:50:97:fd:07:0c:c0:62:92:05:df.
        Are you sure you want to continue connecting (yes/no)? yes
        Warning: Permanently added 'nicekorea.co.kr,211.174.58.43' to the list of known hosts.
        sspark@nicekorea.co.kr's password: **********
        total 124
        drwx------    5 sspark   webhost      4096 Nov 22 04:03 BACKUP
        drwxr-xr-x    5 sspark   webhost      4096 Sep 26 01:10 Desktop
        drwx------    2 sspark   webhost      4096 Sep 26 01:10 Mail
        drwx------    2 sspark   webhost      4096 Sep 26 05:00 apache
        -rwx------    1 sspark   sspark        141 Nov 16 22:01 autobackup-store-script
        drwx------    2 sspark   webhost      4096 Sep 26 04:57 etc
        -rw-r--r--    1 sspark   sspark      30019 Nov 16 19:42 index.html
        drwxr-xr-x    2 sspark   webhost      4096 Sep 26 04:55 mail
        drwx------    2 sspark   webhost      4096 Sep 26 05:00 mysql
        drwx------    3 sspark   webhost      4096 Nov 17 20:17 security
        -rw-r--r--    1 sspark   webhost     44949 Sep 26 23:22 shop.tar.gz
        drwxr-xr-x    3 sspark   webhost      4096 Sep 26 07:46 shoppingcart
        drwx------    2 sspark   webhost      4096 Sep 26 04:54 tools
        drwx---r-x    2 sspark   webhost      4096 Oct 15 12:49 www


icon04.gif 9. 윈도우에서 SSH로그인을 위한 프로그램

 

http://www.ssh.com의 적당한 미러사이트에서 윈도우용 SSH프로그램을 다운받아서 사용한다.

 

또한가지는  Tera Term Pro 라는 프로그램으로

 

http://hp.vector.co.jp/authors/VA002416/teraterm.html에서 다운받을 수 있다.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,070 명
  • 현재 강좌수 :  35,986 개
  • 현재 접속자 :  496 명