Hi Jone,
Jone <[email protected]> writes:
> Hello! I want enter user/root password only once per session. To do this,
> it will probably be convenient to export the password to shell variable.
> For example, adding this to PAM configuration file:
>
> auth sufficient pam_exec.so expose_authtok /path/to/script.sh
>
> But how to write it in system-config.scm? Sorry, I couldn't find any examples.
I don’t fully understand what you are trying to do, but here’s your
example translated into Guix:
(operating-system
...
(pam-services (append (list (pam-service
(name "my-pam-service") ; or whatever
(auth (list (pam-entry
(control "sufficient")
(module "pam_exec.so")
(arguments
(list "expose_authok"
"/path/to/script.sh")))))))
(base-pam-services))))
Note that the “arguments” field of “pam-entry” takes G-Expressions.
This means that the script you want to execute could be a Guile script
built using “program-file”. Alternatively, it could be a shell script
built using “computed-file” or some script that is outside of the store
using an absolute path.
Hope that helps!
-- Tim