pam_ssh_agent_auth icon indicating copy to clipboard operation
pam_ssh_agent_auth copied to clipboard

add argument: default_ssh_auth_sock and some fixes

Open edward-p opened this issue 3 years ago • 1 comments

Useful when SSH_AUTH_SOCK can't be set in environment. For example: loging in from a Display Manager (such as SDDM).

edward-p avatar Feb 06 '22 18:02 edward-p

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.

kgabor545 avatar Jul 17 '22 08:07 kgabor545