[ 작업 환경 ]

Ansible 서버 : Centos 6.8

세팅 타겟 서버 : Centos 7.7

 

 

 

# 에러 문구 발생 예시

TASK [Gathering Facts] ******************************************************************************************************************************************************************************************************************
fatal: [999.888.777.666]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that the RSA host key has just been changed.\r\nThe fingerprint for the RSA key sent by the remote host is\n58:41:e7:fb:4f:5f:06:99:a5:00:0c:ef:a9:b8:f0:cf.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending key in /root/.ssh/known_hosts:795\r\nPassword authentication is disabled to avoid man-in-the-middle attacks.\r\nKeyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
fatal: [111.222.333.444]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that the RSA host key has just been changed.\r\nThe fingerprint for the RSA key sent by the remote host is\n31:f8:ce:2e:9a:01:b2:25:f2:47:ca:f2:fa:d7:98:b1.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending key in /root/.ssh/known_hosts:794\r\nPassword authentication is disabled to avoid man-in-the-middle attacks.\r\nKeyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
        to retry, use: --limit @/home/testuser/ansible/OS_Default_Setting.retry

위 문구 발생된 작업 환경의 경우 999.888.777.666과 111.222.333.444라는 IP인 서버에 대한 ansible 커맨드를 입력했기 때문에 두 줄 발생하였습니다.

 

 

 

 

 

 [ 해결 방법 ]

ansible 작동시키는 계정의 홈/.ssh 안에 있는 known_hosts의 앤서블 세팅 대상 서버 줄을 삭제해줍니다. 해당 서버에 대한 잘못된 키값이 저장되어있기 때문입니다. 삭제해서 비정상 값을 참조하지 않도록 해줍니다.

cd ~/.ssh/
vim known_hosts

 

 

 

 

 

앤서블 작동 방법 참조 게시글은 아래 링크를 통해 확인할 수 있습니다.

https://growingsaja.tistory.com/376

 

 

+ Recent posts