PROBLEM: memory disk, autologin and pam_mkhomedir

From: O. Hartmann <ohartman_at_zedat.fu-berlin.de>
Date: Mon, 12 Sep 2016 15:34:54 +0200
Hello all.

Running a small NanoBSD image that is supposed to provide only a one-user,
single simple session utilizing Firefox, I run into problems.

The setup targets a security sensitive issue, so the /home folder is
created as a memory disk and of limited size via /etc/fstab.

The user, called "autologin" for simple reasons, has the proper settings
in /etc/gettytab:

#
#   Autologin Terminal
#
Pc-auto|Pc autologin console:\
	:tc=Pc:sp#230400:\
	:al=autologin:

and its settings in /etc/ttys meets this requirement by:

ttyv1   "/usr/libexec/getty Pc-auto"            xterm   on  secure

So far. To make this user a real autologin user, I also added
to /etc/pam.d/system the recommendation as of:

# session
session                required        /usr/local/lib/pam_mkhomedir.so \
mode=0750 session   
required        pam_lastlog.so          no_fail


Obviously, this logix doesn't apply. The user "autologin" gets logged in to
"/", on the console I have some error message saying 

[...]
No home directory.
Logging in with home = "/"

The user is located in root's root. Typing "cd" at the carret puts then this
user into /home/autolgin - as expected, but too late!

I guess autologin logs in users way to early, or something is missing in the
pam_mkhomedir config, but I can't find out what. I tried to check also
login.conf(5) for suitable answeres, but none found. The operator :requirehome:
in /etc/login.conf can not be used, since the creation of the home on loggin
doesn't work as expected.

Is this a bug or a feature? Is there a solution to this?

Thank you very much in advance for your help,

Kind regards,
Oliver
Received on Mon Sep 12 2016 - 11:35:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC