I am using JSch to develop an automation client that configures remote Linux servers. CLI of these servers is exposed through ILOM interface. When I am running commands remotely from local box (via JSch) to servers, it errors out saying "shell: Invalid credentials". And with same credentials I am able to SSH to servers from my terminal. How should I fix this?
I ran " ssh <user>@<server-ip> "ls" " with password <pass> from my local terminal to one of these servers, and it gave me "shell: Invalid credentials" error.
But when I ran " echo "ls" | ssh -t <user>@<server-ip>
" with same password <pass>, it ran successfully without any error. So is there any way through which I tell JSch to execute commands in format " echo "<cmd>" | ssh -t <user>@<server-ip>
", rather than " ssh <user>@<server-ip> "<cmd>"