Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ** Initialises SSH Session **/
- ssh_session initialise_ssh(char* host, int port) {
- ssh_session my_ssh_session;
- int verbosity = SSH_LOG_PROTOCOL;
- my_ssh_session = ssh_new();
- ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, host);
- ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
- ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port);
- rc = ssh_connect(current_session);
- if (rc != SSH_OK)
- {
- fprintf(stderr, "Error connecting host: %sn",
- ssh_get_error(current_session));
- return my_ssh_session;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement