[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ssh_channel_request_exec is Failing, returning -1.
[Thread Prev] | [Thread Next]
- Subject: Re: ssh_channel_request_exec is Failing, returning -1.
- From: Jakub Jelen <jjelen@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 22 Jun 2020 12:26:00 +0200
- To: libssh@xxxxxxxxxx
On Mon, 2020-06-22 at 05:18 +0000, V Sidnal, Nagraju wrote: > Hi Jakub, > > I tried same with Default SSH server running on Debain 9. However > it still failed.. > channel = ssh_channel_new(my_ssh_session); > rc = ssh_channel_open_session(channel); > rc = ssh_channel_request_pty(channel); > rc = ssh_channel_request_shell(channel); > rc = ssh_channel_request_exec(channel, command.c_str()); If you open shell already, request_exec is no longer possible in that particular channel. At that point, the shell is already running in the server and you can run commands there by sending data to it and reading data as described in tutorial: https://api.libssh.org/stable/libssh_tutor_shell.html If I read the logs right, device does not allow you to exec command directly, but allows only shell access. Hope it helps, -- Jakub Jelen Senior Software Engineer Security Technologies Red Hat, Inc.
RE: ssh_channel_request_exec is Failing, returning -1. | "V Sidnal, Nagraju" <nagraju.sidnal@xxxxxxxxxxx> |
ssh_channel_request_exec is Failing, returning -1. | "V Sidnal, Nagraju" <nagraju.sidnal@xxxxxxxxxxx> |
Re: ssh_channel_request_exec is Failing, returning -1. | Jakub Jelen <jjelen@xxxxxxxxxx> |
RE: ssh_channel_request_exec is Failing, returning -1. | "V Sidnal, Nagraju" <nagraju.sidnal@xxxxxxxxxxx> |