pam_ssh_agent_auth
pam_ssh_agent_auth copied to clipboard
add argument: default_ssh_auth_sock and some fixes
Useful when SSH_AUTH_SOCK
can't be set in environment. For example: loging in from a Display Manager (such as SDDM).
Thank you it solved my problem. I can use pam_ssh_auth_sock in polkit-1. I just added a little modification to pam_ssh_agent_auth.c:
#include "misc.h"
...
if(default_ssh_auth_sock && user) {
default_ssh_auth_sock = pamsshagentauth_percent_expand(default_ssh_auth_sock,
"h", getpwnam(user)->pw_dir,
"u", user, NULL);
}
I'm not sure this is the way to achieve %h, %u expansion in code, but it does it's job.
I make a symlink from the actual socket to the users home with a static name .ssh_auth_sock
maybe it could be also a default name if no environment variable.