[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing passphrase as parameter?

Hi Alex

why don't you generate host keys without a password? If you put the
password of the keys into your code instead of entering it manually, it
is as good as having no password at all. Private SSH host keys should
never leave the machine they were generated on anyway and should only be
accessible by root.


Am 27.01.2017 um 06:11 schrieb alex rosky:
> Hello there,
> I'm coding a simple SSH server for learning and I have created dsa and
> rsa keys passing a passphrase. now in my ssh server code, when calling
> ssh_bind_listen, it prompts for this passphrase so my question is, is
> there any way to pass this passphrase as parameter or by callback or
> something without needing to write this manually? my pseudocode:
>  port = 5555;
> hsession= ssh_new();
> hbind= ssh_bind_new();
> ssh_bind_options_set(hbind, SSH_BIND_OPTIONS_BINDPORT, &port);
> ssh_bind_options_set(hbind, SSH_BIND_OPTIONS_DSAKEY, "ssh_host_dsa_key");
> ssh_bind_options_set(hbind, SSH_BIND_OPTIONS_RSAKEY, "ssh_host_rsa_key");
> ssh_bind_listen(hbind)
> Thanks.
> Alex Jackson.

Re[2]: passing passphrase as parameter?alex rosky <alex22sky@xxxxxxx>
passing passphrase as parameter?alex rosky <alex22sky@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org