aboutsummaryrefslogtreecommitdiff
path: root/examples/ssh_server_fork.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-24examples: add public key authentication to ssh_server_forkEric Bentley1-2/+67
I noticed that there was no example showing server side public key encryption in the examples so I added this one. I used authorizedkeys as a global to minimize the changes to the original code as well as I was not sure the correct methodology of determining the .ssh directory location for a user not using Linux. One code using the user parameter to determine the location to use instead if desired. Signed-off-by: Eric Bentley <ebentley66@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24exmpales: Init rc in ssh_server_forkAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30example: Add missing error checks in ssh_server_forkAndreas Schneider1-1/+11
CID 1393676 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14examples: Do not include internal headers in ssh_server_forkAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-20examples: Use safer names for stdin, stdout, stderrWilliam Orr1-20/+20
BUG: https://red.libssh.org/issues/168 On some platforms, like OpenBSD, stdin and friends are macros which break compilation of this struct. I've fixed these names such that it compiles and runs cleanly on OpenBSD Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-09examples: Update ssh_server_fork for new SSH_BIND_OPTIONS_HOSTKEYAlan Dunn1-4/+6
Tested by ssh_server_fork -k <an ecdsa key> -k <an rsa key> ... and connection succeeded with OpenSSH clients both for ECDSA and RSA (the latter forced via -o HostKeyAlgorithms=ssh-rsa and some known hosts clearing was necessary). Also ssh_server_fork -k <an ecdsa key> -k <another ecdsa key> ... caused the second key to be used, as expected. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27examples: Add ECDSA key option to ssh_server_forkAlan Dunn1-4/+22
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27examples: Add no default keys options to ssh_server_forkAlan Dunn1-5/+40
It seems useful to be able to run ssh_server_fork without being required to load some key of RSA and DSA keytypes. However, with the current ssh_server_fork, you need to have some keys as some default value is set by default and you can't unset the value for a keytype (e.g. by using NULL as an argument). So the "no default keys" argument turns off the default key assignments. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-17examples: Add missing include for stderr.Andreas Schneider1-0/+1
This should fix the build on FreeBSD.
2014-02-16examples: Add ssh_server_fork exampleAudrius Butkevicius1-0/+641
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>