Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2016 15:34:54 +0200
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   PROBLEM: memory disk, autologin and pam_mkhomedir
Message-ID:  <20160912153454.485aa6a3@freyja.zeit4.iv.bundesimmobilien.de>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160912153454.485aa6a3>