/ 레드햇

5.2 Connecting to a Server with SSH

레드햇 rhcsa ssh
https://4am.kr/5-2-connecting-to-a-server-with-ssh/

클라이언트 쪽 SSH 접속

ssh_ex_1_localhost
ssh_ex_2_knownhostyes
ssh_ex_3_logout
ssh_ex_4_customport
ssh_ex_5_edit_knownhostfile1
ssh_ex_6_edit_knownhostfile2

  • 다음과 같은 경고를 띄울 때
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /home/사용자/.ssh/known_hosts to get rid of this message.
Offending key in /home/사용자/.ssh/known_hosts:1
RSA host key for 4am.kr has changed and you have requested strict checking.
Host key verification failed.
  • vim ~/.ssh/known_hosts
  • bad key를 dd로 삭제한다.
  • 다시 접속하면 에러가 없다.

서버 쪽 설정

  • root 사용자로 로그인 해 서버측 sshd 설정을 수정해 본다.
    ssh_ex_7_edit_sshd_config
    ssh_ex_8_vim_sshd_config1
  • Port, PermitRootLogin 부분은 꼭 알아둘 필요가 있다.
    ssh_ex_9_vim_sshd_config2_port
    ssh_ex_10_vim_sshd_config3_permitrootlogin