I'm not sure if i'm allowed to ask this type of questions here but i hope i'm not violent any rules. lately i'm reading about SSH and trying to start some basic programs about sending ssh commends to an SSH remote device (my device i a raspberry pi) and i'm using windows and c and language, the libssh2 is working fine but the lack of documentation and i mean the lack of some details about the function specification. I'm still noob about SSH protocol and i'm getting confusing about the difference between those functions and how they works:
libssh2_channel_read()
libssh2_channel_write()
libssh2_channel_exec()
i manage to run a commend using the libssh2_channel_exec()
function which send a commend to the SSH remote to run the commend i'm asking for (for example "uptime") and using the libssh2_channel_read()
i can read the results. but when it comes to the libssh2_channel_write()
function i have no clue how to use it or what is the difference between write and exec. what i get it the write function will not block the communication (i'm not sure what does that mean).
so to be clear, y question is, what is the difference between libssh2_channel_write()
and libssh2_channel_exec()
and how i can use libssh2_channel_write()
function and read the result.
i will appreciate any link or documentations or tutorial about libssh2 in c.
thank you.