libssh.so中设置密码的接口函数
/usr/lib64/libssh.so.4.4.0
/usr/include/libssh/libssh.h头文件中有声明:
传入密码通过以下接口:
int ssh_userauth_password(ssh_session session, const char *username, const char *password);
int ssh_userauth_kbdint_setanswer(ssh_session session, unsigned int i, const char *answer);
交互式获取密码的接口为:
s = opts->auth_password(session->username, session->host, opts->auth_password_priv);
answer = opts->auth_interactive(ssh_userauth_kbdint_getname(ssh_sess), ssh_userauth_kbdint_getinstruction(ssh_sess), prompt, echo, opts->auth_interactive_priv);