I'm trying to send an ssh command non-interactively to an HP automation server's proxy, and while I can ssh in and enter it interactively perfectly fine, I always get the message "exec request failed on channel 0" when attempting to send the command over non-interactively. Is there anything that I could change on the client side to allow me to send the command over? There's not much that I can change on the server side.

enter image description here

Apparently it's possible, but I just can't get it working on my install (see link: https://community.hpe.com/t5/Network-Automation-Practitioners/Is-there-a-way-to-issue-a-command-to-an-NA-proxy-using-SSH-non/m-p/6935003/highlight/false#M2821)

In case it would help, here are the version details for my OS and openssh version:

OpenSSH_7.2p2, OpenSSL 1.0.2j-fips  26 Sep 2016

NAME="openSUSE Leap"
PRETTY_NAME="openSUSE Leap 42.2"

Thank you

3 Answers 3


Usually because the client is asking for a tty, and the server is refusing. Try NOT requesting tty with an ssh -T ......


The server is allowing you to open an interactive shell but not the exec system call to execute a command without a pseudo-terminal. Use the -t switch as follows to force pseudo-terminal allocation.

ssh [email protected] -p 8022 -t show version

Alternatively, use expect to script an interaction with the remote endpoint. See this answer for an example.



Do you have anything in your shell rcfile (.bashrc, .zshrc, etc) or .login, .profile, etc that is checking to make sure the shell is interactive before it runs? If not, that's where your problem lies.

My advice is to temporarily rename things like .profile, .bashrc, .login, and .bash_profile to be .profile.off (and so on) and see if the problem still exists.

If it doesn't, you need some code in the offending rcfile that will check to make sure the shell is interactive before it runs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .