1.6 KiB
1.6 KiB
Linux+ 3.1.1: PAM, polkit and directory services
Reading a PAM stack, blocking logins with pam_nologin, and looking at a
polkit action.
Before you start
The lab creates user pat (password Lab-Pass-1), a normal account that
can log in over SSH. Write answers to the files in /root/lab-answers/.
Task 2 blocks new logins for everyone but root for a while: keep a root
shell open (sudo -i) until you've removed the block.
Tasks
- Read sshd's PAM stack in
/etc/pam.d/sshd. Itsauthlines hand over to a shared file of the system (withsubstackon the RHEL family,@includeon Ubuntu). Write that file's name to/root/lab-answers/1. On the RHEL family, also see whatauthselect currentsays. - Block logins for everyone but root with
pam_nologin, with the messageMaintenance until 11:00. Tryssh pat@localhostand save what it prints to/root/lab-answers/2. Then remove the block, so that pat can log in again. - Look at the polkit actions with
pkaction. Find the authorization thatorg.freedesktop.systemd1.manage-unitsneeds from a user in an active local session, and write it to/root/lab-answers/3. If you like, trypkexec idtoo (on Ubuntu, installpkexecfirst). - If you have an AD or FreeIPA test domain, run
realm discoverandrealm joinagainst it, thenida domain user. If not, readman sssd.confandman realm. Not graded.
Hints
cat /etc/pam.d/sshd;authselect current./etc/nologin;ssh pat@localhost 2>&1 | tee /root/lab-answers/2.pkaction --verbose --action-id ..., theimplicit active:line.