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,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,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
debug1: kex: client->server aes128-cbc hmac-sha1 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