[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Customize PAM configuration
From: |
Timothy Sample |
Subject: |
Re: Customize PAM configuration |
Date: |
Sat, 10 Aug 2019 10:44:35 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Hi Jone,
Jone <address@hidden> 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