PreferredAuthentications SSH 설정은 어디에서 왔습니까?

PreferredAuthentications SSH 설정은 어디에서 왔습니까?

SSH 사용자 이름 및 비밀번호 설정을 사용하여 표준 Ansible(v2.3.1) 플레이북을 실행하고 있습니다. '-vvvv' 설정을 사용할 때 이러한 SSH 명령이 생성되는 것을 볼 수 있습니다.

EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s 
-o StrictHostKeyChecking=no -o Port=2222 
-o KbdInteractiveAuthentication=no 
-o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=dc_user -o ConnectTimeout=10

위의 경우 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey' 설정을 가져오는 위치는 어디입니까? 나는 이것이 클라이언트 SSH 구성 설정에서 나온 것이라고 생각하지만 이것이 맞습니까?

나는 'ansaible.cfg'에서 이것을 정의하여 ssh 인수를 무시할 수 있다는 것을 이해합니다.

[ssh_connection]
scp_if_ssh=True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey

누군가 나에게 이것을 설명해 줄 수 있습니까? 감사해요

답변1

나는 그것이 -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey하드 코딩되어 있음 을 관찰했습니다.소스 코드

을 재정의하면 ssh_argsssh 명령줄에 추가되지만 대체되지는 않습니다.ansible.cfg-o PreferredAuthentications=publickey-o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey

예:

$ grep ssh_args /etc/ansible/ansible.cfg 
#ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o     PreferredAuthentications=publickey
$ ansible rhel7a -m ping -vvvv |grep EXEC
<rhel7a> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/user/.ansible/cp/13dd447a86 rhel7a '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''

관련 정보