# ansible Failed when connected to H3C switch by ssh

**URL:** <https://forum.ansible.com/t/ansible-failed-when-connected-to-h3c-switch-by-ssh/28545>\
**Category:** Ansible Project\
**Created:** [September 11, 2018, 5:15am UTC](https://forum.ansible.com/t/ansible-failed-when-connected-to-h3c-switch-by-ssh/28545 "2018-09-11T05:15:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.ansible.com/u/Jason_Zhou)\
**Post date:** [September 11, 2018, 5:15am UTC](https://forum.ansible.com/t/ansible-failed-when-connected-to-h3c-switch-by-ssh/28545/1 "2018-09-11T05:15:17Z")

</div>

![image](https://user-images.githubusercontent.com/397285/45293152-eed4a500-b529-11e8-9a3e-ab6a0d3d3cc3.png)

1. ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user1 -o ConnectTimeout=5 -o ControlPath=/root/.ansible/cp/4c801cc0ae 1.1.1.1 ‘/bin/sh -c ‘"’“‘echo ~$USER && sleep 0’”’"‘’

2. ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user1 -o ConnectTimeout=5 -o ControlPath=/root/.ansible/cp/4c801cc0ae 1.1.1.1

Why dose 1st one fail but 2nd succeed，Is that a BUG in ansible version 2.5.3?

![ansible-version](https://user-images.githubusercontent.com/397285/45293280-4541e380-b52a-11e8-9e7b-edbc54f9a813.png)
