2020. 7. 16.

[Linux] SSH_KEY 실습


  1. 구성과 계획
  • 네트워크 구성도

서버 att7 - 192.168.10.150/00:0c:29:a1:3f:e0
패킷 캡처 att6 - 192.168.10.149/00:0C:29:C6:9A:42
클라이언트 att5 - 192.168.10.148/00:0C:29:5D:87:05

  • 과정 정리
step1. 클라이언트에서 생성
step2. 공개키를 서버로 이전
step3. 패스워드 없는 접속 테스트


  1. 관련내용정리
ssh : 공개키를 미리 저장하고 공개키를 이용한 인증방식
공개키 : 인가된 사용자에게 알려주는
개인키 : 자신만 알고 있는
비밀키 : 통신하는 두명만 알고 있는
세션키 : 1회성 키로 보통은 비밀키를 주고 받을 사용

  1. 실습과정

step1. 클라이언트에서 생성
ssh-keygen -t rsa -b 2048
Croot@localhost ssh-keygen -t rsa -b 2ß48 
Generating public/private rsa key p 
Enter file in which to save the key ( / root/ .ssh/id_rsa) 
nter passp rase empty or no passp rase 
nter same ass h rase a ain: 
Your identification has been saved in 'root/ .ssh/id rsa. 
Your public key has been saved in /root/.ssh/id_rsa.pub. 
k fin e r r int is: 
localhost. localdomain
키가 저장될 경로와 암호이를 입력하고나면 무결성검증을 위한 해시값과 함께 키가 생성된다.

step2. 공개키를 서버로 이전
ssh-copy-id root@192.168.10.150
Croot@localhost ssh-copy-id root@192.168.Ia.Isa 
The authenticity of host '192.168.1ø.15ø (192.168.1m 1%)' can't 
be established. 
RSA key fingerprint is e8:14:c3:74:8e:8c:ef:35:aI:d3:3e:2d:14:aa:c9:d4. 
Are you sure you want to continue connecting 
Warnin . 
Permanentl added ' 192.168.1ø.15ø' (RSA) to the list of 
known hosts . 
root@192.168.Ie.15e's password: 
with "ssh ' root@192.168.Iø.15ø'", 
and check in 
ry ogglng In o 
e mac Ine, 
. ssh/authorized_keys 
to make sure we haven't added extra keys that you weren't expecting.
yes 계정 암호를 입력하고 나면 키가 복사된다.

step3. 패스워드 없는 접속 테스트
ssh root@192.168.10.150
root@154:- 
Croot@localhost ifconfig head -5 
ethe 
Link encap:Ethernet Héaddr 
inet acast:192.168.1e.255 
mask:255.255.255.ø 
inet6 addr: fe8ß: Scope: Link 
up BROADCAST RUNNING MULTICAST MTU:1søe metric: 1 
RX packets: 12713746 ernrs:ø dropped:ø overruns:ø frame:ø 
Croot@localhost ssh root@192.168.Ia.Isa 
Enter passphrase for key ' 'root/ .ssh/id_rsa': 
root@192.168.Ia.Isa's password: 
Last login: Thu Jul 16 2ø2ø from 192.168.1ø.146 
Croot@154 ifconfig head -5 
ens32: mtu 15øø 
inet netmask 255.255.255.ø broadcast 192.168.1ø.255 
inet6 fe8ø: prefixlen 64 scopeid 
ether txqueuelen Iøøø (Ethernet) 
RX packets 18852 bytes 17117837 (16.3 Mia) 
Croot@154



댓글 없음:

댓글 쓰기