SSH Error 255 When executing command

617 views
Skip to first unread message

empiret

unread,
Jan 5, 2016, 11:38:58 AM1/5/16
to robotframework-users
Hello,

Here is my simple code using SSHLibrary:

Execute My Command via SSH

    Set Default Configuration    loglevel=TRACE
    Open Connection    ${IP}    prompt=$    timeout=10s
    SSHLibrary.Enable Ssh Logging    C:\\Apps\\Robot_projects\\toto.txt
    ${out}    SSHLibrary.Login    aUser    aPass    delay=10s
    ${out}    ${out1}    ${out2}    SSHLibrary.Execute Command    pwd   return_stdout=True    return_rc=True    return_stderr=True
    [Teardown]    SSHLibrary.Close All Connections

The connection is succefull, but executing command fails.

Output Robotframework:

20160105 15:51:49.205 :  INFO : Executing command 'pwd'.
20160105 15:51:49.535 :  INFO : Command exited with return code 255.
20160105 15:51:49.536 :  INFO : ${out} = 
20160105 15:51:49.536 :  INFO : ${out1} = 
20160105 15:51:49.536 :  INFO : ${out2} = 255

Any idea?

Here is the log file content:
DEB [20160105-17:33:35.846] thr=1   paramiko.transport: starting thread (client mode): 0x42f5780L
DEB [20160105-17:33:35.848] thr=1   paramiko.transport: Local version/idstring: SSH-2.0-paramiko_1.16.0
DEB [20160105-17:33:35.913] thr=1   paramiko.transport: Remote version/idstring: SSH-2.0-OpenSSH_7.1
INF [20160105-17:33:35.913] thr=1   paramiko.transport: Connected (version 2.0, client OpenSSH_7.1)
DEB [20160105-17:33:35.953] thr=1   paramiko.transport: kex algos:[u'curve255...@libssh.org', u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group14-sha1'] server key:[u'ssh-rsa', u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client encrypt:[u'chacha20...@openssh.com', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes12...@openssh.com', u'aes25...@openssh.com'] server encrypt:[u'chacha20...@openssh.com', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes12...@openssh.com', u'aes25...@openssh.com'] client mac:[u'umac-...@openssh.com', u'umac-1...@openssh.com', u'hmac-sha...@openssh.com', u'hmac-sha...@openssh.com', u'hmac-s...@openssh.com', u'uma...@openssh.com', u'umac...@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] server mac:[u'umac-...@openssh.com', u'umac-1...@openssh.com', u'hmac-sha...@openssh.com', u'hmac-sha...@openssh.com', u'hmac-s...@openssh.com', u'uma...@openssh.com', u'umac...@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] client compress:[u'none', u'zl...@openssh.com'] server compress:[u'none', u'zl...@openssh.com'] client lang:[u''] server lang:[u''] kex follows?False
DEB [20160105-17:33:35.953] thr=1   paramiko.transport: Kex agreed: diffie-hellman-group14-sha1
DEB [20160105-17:33:35.953] thr=1   paramiko.transport: Cipher agreed: aes128-ctr
DEB [20160105-17:33:35.953] thr=1   paramiko.transport: MAC agreed: hmac-sha2-256
DEB [20160105-17:33:35.953] thr=1   paramiko.transport: Compression agreed: none
DEB [20160105-17:33:36.052] thr=1   paramiko.transport: kex engine KexGroup14 specified hash_algo <built-in function openssl_sha1>
DEB [20160105-17:33:36.052] thr=1   paramiko.transport: Switch to new keys ...
DEB [20160105-17:33:36.055] thr=2   paramiko.transport: Adding ssh-rsa host key for XXXXXX: XXXXXX
DEB [20160105-17:33:36.390] thr=1   paramiko.transport: userauth is OK
INF [20160105-17:33:36.438] thr=1   paramiko.transport: Authentication (password) successful!
DEB [20160105-17:33:36.456] thr=2   paramiko.transport: [chan 0] Max packet in: 32768 bytes
DEB [20160105-17:33:36.493] thr=1   paramiko.transport: Received global request "hostk...@openssh.com"
DEB [20160105-17:33:36.493] thr=1   paramiko.transport: Rejecting "hostk...@openssh.com" global request from server.
DEB [20160105-17:33:36.726] thr=1   paramiko.transport: [chan 0] Max packet out: 32768 bytes
DEB [20160105-17:33:36.726] thr=1   paramiko.transport: Secsh channel 0 opened.
DEB [20160105-17:33:36.801] thr=1   paramiko.transport: [chan 0] Sesch channel 0 request ok
DEB [20160105-17:33:36.859] thr=1   paramiko.transport: [chan 0] Sesch channel 0 request ok
DEB [20160105-17:33:36.964] thr=2   paramiko.transport: [chan 1] Max packet in: 32768 bytes
DEB [20160105-17:33:37.007] thr=1   paramiko.transport: [chan 1] Max packet out: 32768 bytes
DEB [20160105-17:33:37.007] thr=1   paramiko.transport: Secsh channel 1 opened.
DEB [20160105-17:33:37.094] thr=1   paramiko.transport: [chan 1] Sesch channel 1 request ok
DEB [20160105-17:33:37.095] thr=1   paramiko.transport: [chan 1] EOF received (1)
DEB [20160105-17:33:37.095] thr=1   paramiko.transport: [chan 1] EOF sent (1)
DEB [20160105-17:33:37.107] thr=2   paramiko.transport: [chan 0] EOF sent (0)
DEB [20160105-17:33:37.196] thr=1   paramiko.transport: EOF in transport thread

Jari Nurminen

unread,
Jan 5, 2016, 12:59:50 PM1/5/16
to tahia.ab...@gmail.com, robotframework-users
Howdy,
 
is it only pwd that fails or all other commands too?
 
- Jari -
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

empiret

unread,
Jan 5, 2016, 2:39:23 PM1/5/16
to robotframework-users, jari...@gmail.com
Yes, the error occurs with any commands.

empiret

unread,
Jan 5, 2016, 2:41:10 PM1/5/16
to robotframework-users, jari...@gmail.com
In addition, if I use ssh command line and then write "pwd", it works. I have this issue only when I use SSHLibrary.

Jari Nurminen

unread,
Jan 6, 2016, 1:07:13 AM1/6/16
to empiret, robotframework-users
sounds weird - here's some ideas how to troubleshoot further:
1) try running the commands with "write" keyword ("execute command" runs the command in new shell)
2) try running the command without SSHLibrary (i.e. ssh user@host.domain.com "pwd")
 
Based on the results from above you could then google for something like "ssh script error 255"
 
------ Original Message ------
From: "empiret" <tahia.ab...@gmail.com>
To: "robotframework-users" <robotframe...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages