# SSH Issue with HP switch Comware 7

**URL:** <https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433>\
**Category:** Ansible Project\
**Created:** [February 3, 2016, 5:48am UTC](https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433 "2016-02-03T05:48:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user34](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@user34](https://forum.ansible.com/u/user34)\
**Post date:** [February 3, 2016, 5:48am UTC](https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433/1 "2016-02-03T05:48:41Z")

</div>

Hi!

I am trying to establish SSH connection to HP switch and process simple commands on it. Unfortunately, couple days of working on this task was not successful. I am working on Mac, ansible version 2.0. Command that I am trying to execute:

_sudo ansible TEMP -m raw -a “dis stp root” -vvvv_

My hosts file:

_[TEMP]_

_1.1.1.1 ansible\_connection=ssh ansible\_ssh\_user=admin ansible\_ssh\_pass=\*\*\*_

Current ansible.cfg file:

_[defaults]_

_transport=paramiko_

_host\_key\_checking=False_

_timeout = 5_

Other parameters are default.

This is debug result:

_Using /etc/ansible/ansible.cfg as config file_

_Loaded callback minimal of type stdout, v2.0_

_\<1.1.1.1\> ESTABLISH SSH CONNECTION FOR USER: admin_

_\<1.1.1.1\> SSH: EXEC sshpass -d25 ssh -C -vvv -o ControlMaster=no -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=admin -o ConnectTimeout=5 -o ControlPath=/Users/denis/.ansible/cp/ansible-ssh-%h-%p-%r -tt 1.1.1.1 ‘dis stp root’_

_1.1.1.1 | FAILED | rc=255 \>\>_

_OpenSSH\_6.9p1, LibreSSL 2.1.8_

_debug1: Reading configuration data /etc/ssh/ssh\_config_

_debug1: /etc/ssh/ssh\_config line 20: Applying options for \*_

_debug1: /etc/ssh/ssh\_config line 102: Applying options for \*_

_debug1: Control socket “/Users/denis/.ansible/cp/ansible-ssh-1.1.1.1-22-admin” does not exist_

_debug2: ssh\_connect: needpriv 0_

_debug1: Connecting to 1.1.1.1 [1.1.1.1] port 22._

_debug2: fd 3 setting O\_NONBLOCK_

_debug1: fd 3 clearing O\_NONBLOCK_

_debug1: Connection established._

_debug3: timeout: 5000 ms remain after connect_

_debug1: permanently\_set\_uid: 0/0_

_debug1: key\_load\_public: No such file or directory_

_debug1: identity file /var/root/.ssh/id\_rsa type -1_

_…_

_debug1: Enabling compatibility mode for protocol 2.0_

_debug1: Local version string SSH-2.0-OpenSSH\_6.9_

_debug1: Remote protocol version 1.99, remote software version Comware-7.1.045_

_debug1: no match: Comware-7.1.045_

_debug2: fd 3 setting O\_NONBLOCK_

_debug1: Authenticating to 1.1.1.1:22 as ‘admin’_

_debug3: hostkeys\_foreach: reading file “/var/root/.ssh/known\_hosts”_

_debug3: record\_hostkey: found key type RSA in file /var/root/.ssh/known\_hosts:2_

_debug3: load\_hostkeys: loaded 1 keys from 1.1.1.1_

_debug3: order\_hostkeyalgs: prefer hostkeyalgs: [ssh-rsa-cert-v01@openssh.com](mailto:ssh-rsa-cert-v01@openssh.com),ssh-rsa-cert-v00@openssh.com,ssh-rsa_

_debug1: SSH2\_MSG\_KEXINIT sent_

_debug1: SSH2\_MSG\_KEXINIT received_

_debug2: kex\_parse\_kexinit: [curve25519-sha256@libssh.org](mailto:curve25519-sha256@libssh.org),ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1_

_…_

_debug1: kex: server-\>client aes128-cbc hmac-sha1 [zlib@openssh.com](mailto:zlib@openssh.com)_

_debug1: kex: client-\>server aes128-cbc hmac-sha1 [zlib@openssh.com](mailto:zlib@openssh.com)_

_debug1: SSH2\_MSG\_KEX\_DH\_GEX\_REQUEST(1024\<7680\<8192) sent_

_debug1: got SSH2\_MSG\_KEX\_DH\_GEX\_GROUP_

_debug2: bits set: 2088/4096_

_debug1: SSH2\_MSG\_KEX\_DH\_GEX\_INIT sent_

_debug1: got SSH2\_MSG\_KEX\_DH\_GEX\_REPLY_

_debug1: Server host key: ssh-rsa SHA256:GHYG+AcrWb9G+9e1UH+7DOvPKVOJ10ulZ+pySK6LdXM_

_debug3: hostkeys\_foreach: reading file “/var/root/.ssh/known\_hosts”_

_debug3: record\_hostkey: found key type RSA in file /var/root/.ssh/known\_hosts:2_

_debug3: load\_hostkeys: loaded 1 keys from 1.1.1.1_

_debug1: Host ‘1.1.1.1’ is known and matches the RSA host key._

_debug1: Found key in /var/root/.ssh/known\_hosts:2_

_debug2: bits set: 1988/4096_

_debug2: set\_newkeys: mode 1_

_debug1: SSH2\_MSG\_NEWKEYS sent_

_debug1: expecting SSH2\_MSG\_NEWKEYS_

_debug2: set\_newkeys: mode 0_

_debug1: SSH2\_MSG\_NEWKEYS received_

_debug1: Roaming not allowed by server_

_debug1: SSH2\_MSG\_SERVICE\_REQUEST sent_

_debug2: service\_accept: ssh-userauth_

_debug1: SSH2\_MSG\_SERVICE\_ACCEPT received_

_debug2: key: /var/root/.ssh/id\_rsa (0x0),_

_debug2: key: /var/root/.ssh/id\_dsa (0x0),_

_debug2: key: /var/root/.ssh/id\_ecdsa (0x0),_

_debug2: key: /var/root/.ssh/id\_ed25519 (0x0),_

_debug1: Authentications that can continue: password_

_debug3: start over, passed a different list password_

_debug3: preferred publickey,keyboard-interactive,password_

_debug3: authmethod\_lookup password_

_debug3: remaining preferred: ,keyboard-interactive,password_

_debug3: authmethod\_is\_enabled password_

_debug1: Next authentication method: password_

_debug2: we sent a password packet, wait for reply_

_debug1: Enabling compression at level 6._

_**debug1: Authentication succeeded (password).**_

_**Authenticated to 1.1.1.1 ([1.1.1.1]:22).**_

_debug2: fd 6 setting O\_NONBLOCK_

_debug2: fd 7 setting O\_NONBLOCK_

_debug1: channel 0: new [client-session]_

_debug3: ssh\_session2\_open: channel\_new: 0_

_debug2: channel 0: send open_

_debug1: Entering interactive session._

_debug2: callback start_

_debug2: fd 3 setting TCP\_NODELAY_

_debug3: ssh\_packet\_set\_tos: set IP\_TOS 0x10_

_debug2: client\_session2\_setup: id 0_

_debug2: channel 0: request pty-req confirm 1_

_debug1: Sending environment._

_debug3: Ignored env TERM_

_debug3: Ignored env SSH\_AUTH\_SOCK_

_debug3: Ignored env \_\_CF\_USER\_TEXT\_ENCODING_

_debug3: Ignored env PATH_

_debug3: Ignored env HOME_

_debug1: Sending env LC\_CTYPE = UTF-8_

_debug2: channel 0: request env confirm 0_

_debug3: Ignored env DISPLAY_

_debug3: Ignored env SHELL_

_debug3: Ignored env MAIL_

_debug3: Ignored env LOGNAME_

_debug3: Ignored env USER_

_debug3: Ignored env USERNAME_

_debug3: Ignored env SUDO\_COMMAND_

_debug3: Ignored env SUDO\_USER_

_debug3: Ignored env SUDO\_UID_

_debug3: Ignored env SUDO\_GID_

_debug3: Ignored env VERSIONER\_PYTHON\_VERSION_

_debug3: Ignored env VERSIONER\_PYTHON\_PREFER\_32\_BIT_

_debug1: Sending command: dis stp root_

_debug2: channel 0: request exec confirm 1_

_debug2: callback done_

_debug2: channel 0: open confirm rwindow 0 rmax 32768_

_debug2: channel\_input\_status\_confirm: type 99 id 0_

_debug2: PTY allocation request accepted on channel 0_

_debug2: channel\_input\_status\_confirm: type 100 id 0_

_exec request failed on channel 0_

I am looking for any help or advice.

Denis

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 3, 2016, 12:33pm UTC](https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433/2 "2016-02-03T12:33:22Z")

</div>

There was another user (I believe who worked for HP) who was trying to work with these switches at one point. In order to use them he had to write a custom module that utilized paramiko to perform the communication, as opposed to using The Ansible paramiko communication plugin.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 3, 2016, 12:35pm UTC](https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433/3 "2016-02-03T12:35:02Z")

</div>

A quick Google search after my email led me to [http://patg.net/ansible,comware,switches/2014/10/16/ansible-comware/](http://patg.net/ansible,comware,switches/2014/10/16/ansible-comware/)

That post details what was done and appears to offer links to the modules that he wrote.

---

<div class="post-metadata">

**Author:** ![user34](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@user34](https://forum.ansible.com/u/user34)\
**Post date:** [February 3, 2016, 12:50pm UTC](https://forum.ansible.com/t/ssh-issue-with-hp-switch-comware-7/20433/4 "2016-02-03T12:50:41Z")

</div>

Yes, I saw this post. This is additional module for Comware **5.** I am working with 7. Anyway, I tried it, but no success.

Denis.
