troglobit / finit

Fast init for Linux. Cookies included
https://troglobit.com/projects/finit/
MIT License
622 stars 61 forks source link

Add pam support #309

Closed liuming50 closed 1 year ago

liuming50 commented 1 year ago

We are using finit as our init manager, and we found it's seems lack of PAM support?

Is there any plan add PAM support?

troglobit commented 1 year ago

Didn't even know PID 1 needed to know about PAM. Do you have any more information about this, or can explain your requirements?

liuming50 commented 1 year ago

@troglobit like systemd pam: https://www.freedesktop.org/software/systemd/man/pam_systemd.html?_sm_au_=iHVDqr5ZW1FtkF6NH22GBKHMtcjKq

When start a login console from finit, could the session be controlled under PAM?

troglobit commented 1 year ago

Aha, you mean for login. Well, you can use a getty that supports PAM instead of the default getty shipped with Finit. For instance, at my old job we used the BusyBox getty (remember to enable PAM support in BusyBox), which worked fine to set up different PAM chains for local/console and remote logins (ssh/telnet). I've documented it here TTYs and Consoles.

I considered adding PAM support to the Finit getty, but I've not needed it myself yet. If someone cares strongly or want to add PAM support themselves, I'm not against it.

liuming50 commented 1 year ago

@troglobit thanks for the comments, I can try add a tty service with PAM support.

troglobit commented 1 year ago

I've looked into this some more now. From the looks of it you don't need any PAM support in the getty program, only /bin/login, which in the case of BusyBox is available. So I've decided to close this as not-applicable (invalid).