28 June 2012

X11 session login with SLiM and no password

Basically task is to allow my mum login to home Linux-box and not to bother her with a password (or I would have to install Windoze again). At same time I want to still have access to same box with my own passworded account and to be able to login (with SLiM) to a X11 session.

I'm not going to dig into security considerations regarding passwordless users here.

So firstly let's create a user for my mum and deprive it a password:
# useradd -m -U username
# passwd -d username

Explanation:
-m force home directory creation
-U automatically creates a group with same name as username and assigns it as primary group for new user
passwd -d removes password from given account

Now you should be able to login with new user into physical terminal session. Though this depends on PAM configuration in your distro (I'm using ArchLinux). You won't be able to su to this user or login into SLiM yet.
To allow SLiM login you with empty password you need to edit /etc/pam.d/slim:
find
auth    required    pam_unix.so
and change to
auth    required    pam_unix.so nullok

That's it. Same instructions should apply to any login manager, not only SLiM.

No comments: