<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Nov 30, 2017, 12:10 Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> > +# Set up a full user session for the user, required by Weston.<br>
> > +PAMName=login<br>
><br>
> Piggy-backing on "login" is a bad idea. "login" is a text tool, and<br>
> thus the PAM rules for it usually pull in some TTY specific PAM<br>
> modules. YOu shoudl really use your own PAM fragment here, and<br>
> configure only the bits you need.<br>
<br>
Ok. Is there any guide or example I could point people to, so that they<br>
can write their own stuff correctly? Any example I could put into<br>
Weston docs?<br>
<br>
Personally I have no understanding of what PAM does. I just copied<br>
weston-launch (setuid-root helper for non-systemd systems) that also<br>
uses "login" for PAM name if it was asked to create a new session(?).<br></blockquote></div><div><br></div><div>Instead of reusing "login", it would be better to start with a copy e.g. lightdm's or xdm's config, IMHO.</div><div><br></div><div>There are three main steps in PAM. Besides "auth" (authentication, which services simply skip), you also have "account" (authorization and accounting) which verifies whether the user is allowed to log in – e.g. not disabled, not locked out, not time-restricted. <span style="font-size:13px">(For example, SSH pubkey logins don't use PAM auth, but still have to perform the account verification.)</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Usually there's just one global configuration for "account" (e.g. in pam.d/common-account) and you can directly include it.</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">But you also have "session" (session setup), which registers with systemd-logind, sets up SELinux, prints the motd, and so on. These *do* vary greatly between service types – e.g. you want pam_motd for 'login' but not for 'cron'; you want pam_systemd for 'weston' but not for 'ftpd'. So the "session" part may need to be customized, which is why you should start with another graphical manager's.</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div></div>