pam UPDATE auth using Linux PAM
Added the ability to authenticate via Linux PAM when using keyboard-interactive SSH authentication method. One new API call was added.
diff --git a/src/session_client.c b/src/session_client.c
index c29e564..5755a79 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -70,7 +70,7 @@
},
#ifdef NC_ENABLED_SSH
.ssh_opts = {
- .auth_pref = {{NC_SSH_AUTH_INTERACTIVE, 3}, {NC_SSH_AUTH_PASSWORD, 2}, {NC_SSH_AUTH_PUBLICKEY, 1}},
+ .auth_pref = {{NC_SSH_AUTH_INTERACTIVE, 1}, {NC_SSH_AUTH_PASSWORD, 2}, {NC_SSH_AUTH_PUBLICKEY, 3}},
.auth_hostkey_check = sshauth_hostkey_check,
.auth_password = sshauth_password,
.auth_interactive = sshauth_interactive,
@@ -163,17 +163,17 @@
e->refcount = 1;
#ifdef NC_ENABLED_SSH
e->ssh_opts.auth_pref[0].type = NC_SSH_AUTH_INTERACTIVE;
- e->ssh_opts.auth_pref[0].value = 3;
+ e->ssh_opts.auth_pref[0].value = 1;
e->ssh_opts.auth_pref[1].type = NC_SSH_AUTH_PASSWORD;
e->ssh_opts.auth_pref[1].value = 2;
e->ssh_opts.auth_pref[2].type = NC_SSH_AUTH_PUBLICKEY;
- e->ssh_opts.auth_pref[2].value = 1;
+ e->ssh_opts.auth_pref[2].value = 3;
e->ssh_opts.auth_hostkey_check = sshauth_hostkey_check;
e->ssh_opts.auth_password = sshauth_password;
e->ssh_opts.auth_interactive = sshauth_interactive;
e->ssh_opts.auth_privkey_passphrase = sshauth_privkey_passphrase;
- /* callhome settings are the same except the inverted auth methods preferences */
+ /* callhome settings are the same */
memcpy(&e->ssh_ch_opts, &e->ssh_opts, sizeof e->ssh_ch_opts);
e->ssh_ch_opts.auth_pref[0].value = 1;
e->ssh_ch_opts.auth_pref[1].value = 2;