질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

SSH의 공개키 사용한 인증문제 부탁드립니다

작성자 정보

  • 신동휘 작성
  • 작성일

컨텐츠 정보

본문

답변 정말 감사드립니다.

키를 다시 생성하고 접속을 시도해보았지만 결과는 동일하네요.

그림 1-----------------------------------------------------------------

  PC1(Windows)-SSH Client                       PC2(Linux)-SSH Server

       192.168.1.100                                             192.168.1.102

       SecureCRT 사용중

     공개키 : PK1                                             공개키 : PK2

     비밀키 : SK1                                             비밀키 : SK2

   

-------------------------------------------------------------------------

이것 저것 하다 보니까 최초에 접속을 시도할때에 PC2에서 호스트 DSA 공개키(/etc/ssh에 있는 파일)를 받아오더군요

그래서 PC1에서 DSA로 공개키를 생성하여 PC2에 전달하였는데 결과는 역시 동일하게 사용자에 대한 공개/비밀키의 쌍이 맞지 않으므로 공개/비밀키나 사용자 이름을 확인하라고 합니다.

여기서 알고 싶은 점은 PC1에서 PC2로 SSH 접속할때에 과연 어떤 파일들을 읽어들여서 암호화 하는지 알아야 할 것 같습니다.

제가 생각하는것은 PC1에서 PC2로 접속하는 상황을 가정해 볼때 그림1에서 보면 PC1의 공개키 PK1을 PC2로 보내서 PC1은 SK1으로 암호화해서 PC2로 보내고 PC2는 사전에 PC1에서 받은 PK1으로 복호화하여 암호화 통신을 한다고 이해하고 있습니다.

그리고  PC1에서 root가 SSH로 PC2에 로그인한다고 할때에 SecureCRT 프로그램은 초기에 /root/.ssh에 저장해 놓은 PC1의 공개키(authorized_keys 파일)를 확인하여 접속을 할 수 있도록 한다고 이해하고 있습니다.(또는 SecureCRT가 PC2에게 호스트 공개키를 요구하고 PC1은 이렇게 받은 PC2의 호스트 공개키를 가지고 PC1의 공개키를 암호화하여 PC2에게 전송한다. 그리고 PC2는 사전에 저장하여둔 PC1의 공개키(authorized_keys 파일)를 확인하여 로그인 시키도록 한다.)

제가 이해하고 있는 사항이 맞는이 모르겠습니다.

그리고 다시 한번 현재 제 컴퓨터의 sshd_conifg를 첨부하겠습니다.

과연 무엇이 잘못되었을까요? 참 힘드네요....ㅡ.ㅡ;

Port 22
Protocol 2
ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 120
PermitRootLogin yes
#StrictModes yes

PubkeyAuthentication yes
RSAAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys
# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server

관련자료

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

공지사항


뉴스광장


  • 현재 회원수 :  60,138 명
  • 현재 강좌수 :  36,196 개
  • 현재 접속자 :  588 명