Update: SSH client with Libssh

Now might be a good time to start to shed some light on progress with the ssh client to be integrated into the ebrainpool core. As stated we have choosen to use libssh. Thanks to some lovely documentation on the site and examples, getting up and running with basics is quite straight forward. Will get more technical in the following posts, This is just to get things started.

The assumptions here, 1) We are only going to use key based authentication, so no other forms of authentication are going to be implemented. 2) We are really interested in X11 forwarding only, since the primary use of the software would be graphical applications

I will be posting the code once done, but for the impatient this is a quick run down of the functions used from libssh to.

1 set the host: ssh_options_set (my_ssh_session, SSH_OPTIONS_HOST, "localhost");

2: set the port to use: ssh_options_set (my_ssh_session, SSH_OPTIONS_PORT, &port);

3: Check for a known server: ssh_is_server_known

** This step is important, See the documentation of libssh. You need to verify a known server to ensure security. Wont go into detail here.

4 Allocate a buffer with server public key : ssh_get_pubkey_hash

5: Authenticate: ssh_userauth_autopubkey

++ If all goes well, you are now authenticated ++

6 Open a new ssh session: channel_open_session

7 ssh_channel_request_x11

8 ssh_channel_read

At this point, command line stuff works, got some X11 related auth stuff to sort out, which im working on now, Once I get that sorted, will update this.

Previous Post Next Post