Commit 42a92deb authored by Antenore Gatta's avatar Antenore Gatta

Set explicitly SSH identity file for any kind of connection

parent 9d855b12
......@@ -492,6 +492,15 @@ remmina_ssh_init_session(RemminaSSH *ssh)
/* When SSH_OPTIONS_USER is not set, the local user account is used */
if (*ssh->user != 0)
ssh_options_set(ssh->session, SSH_OPTIONS_USER, ssh->user);
if (*ssh->privkeyfile != 0) {
rc = ssh_options_set(ssh->session, SSH_OPTIONS_IDENTITY, ssh->privkeyfile);
if (rc == 0) {
remmina_log_printf("[SSH] SSH_OPTIONS_IDENTITY has been set to: %s\n", ssh->privkeyfile);
}else {
remmina_log_printf("[SSH] SSH_OPTIONS_IDENTITY is not set, by default identity, id_dsa and id_rsa are checked.\n");
}
}
#ifdef SNAP_BUILD
ssh_options_set(ssh->session, SSH_OPTIONS_SSH_DIR, g_strdup_printf("%s/.ssh", g_getenv("SNAP_USER_COMMON")));
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment