Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to make home directory at (RADIUS) user gdm login.

The auth is working right, but when I try gdm says that the user hasn't a home directory.

I tried to do that with pam_mkhomedir.so but is not working.

My /etc/pam.d/gdm file:

PAM-1.0
auth    sufficient  pam_radius_auth.so  
auth    sufficient       pam_nologin.so 
auth    sufficient        pam_env.so readenv=1 
auth    sufficient        pam_env.so readenv=1 envfile=/etc/default/locale
auth    sufficient  pam_succeed_if.so 
@include common-auth 
auth    optional        pam_gnome_keyring.so 
account sufficient  pam_radius_auth.so
@include common-account
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session optional        pam_limits.so 
@include common-session 
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open 
session optional        pam_gnome_keyring.so auto_start 
session required    pam_mkhomedir.so skel=/etc/skel umask=0022
@include common-password

I'm posting the configuration files:

/etc/pam.d/common-account

account sufficient pam_radius_auth.so
session required pam_mkhomedir.so

account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so

/etc/pam.d/common-auth

auth [success=1 default=ignore] pam_unix.so nullok_secure
auth requisite pam_deny.so
auth required pam_permit.so

/etc/pam.d/common-session

session [default=1] pam_permit.so
session requisite pam_deny.so
session required pam_permit.so
session required pam_mkhomedir.so
session required pam_unix.so
session optional pam_ck_connector.so nox11

/etc/pam.d/gdm

auth sufficient pam_radius_auth.so debug
auth requisite pam_nologin.so
auth sufficient pam_env.so readenv=1
auth sufficient pam_env.so readenv=1 envfile=/etc/default/locale
auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
@include common-auth
auth optional pam_gnome_keyring.so
account sufficient pam_radius_auth.so
@include common-account
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session required pam_limits.so
session sufficient pam_mkhomedir.so skel=/home/formacio umask=0022
@include common-session
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
session optional pam_gnome_keyring.so auto_start
@include common-password

/etc/pam.d/login

auth required pam_securetty.so
auth requisite pam_nologin.so
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session required pam_env.so readenv=1
session required pam_env.so readenv=1 envfile=/etc/default/locale
# Standard Un*x authentication.
@include common-auth
auth optional pam_group.so
session required pam_limits.so
session optional pam_lastlog.so
session optional pam_motd.so
session optional pam_mail.so standard
# Standard Un*x account and session
@include common-account
@include common-session
@include common-password
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
share|improve this question
add comment

2 Answers

Forgive me the dumb question, but have you installed the libpam-modules package which contains pam_mkhomedir.so? It's not installed by default on my copy of Ubuntu.

Failing that, you might want to try moving the line to /etc/pam.d/common-session, just in case the config files aren't being called in the order you expect. Your syntax looks correct, so it ought to work once you've got all the pieces in place.

You might also find the pam_debug module useful; it can let you shape exactly what path you want authentication to take.

share|improve this answer
    
Thanks for the advice. libpam-modules are installed. Do I have to copy only the mkhomedir line at /etc/pam.d/common-session? At top, bottom? –  Lorenzo Nov 9 '11 at 10:42
    
I'd try copying the mkhomedir line to the top of common-session. Also, try keeping an eye on /var/log/auth.log while a login is in session; I believe that's where PAM errors will be logged. –  Handyman5 Nov 9 '11 at 17:58
    
Putting mkhomedir line on the top of common-session does not work. At /var/log/auth.log I see nothing related with that because auth is working correctly. Where I can see logs about session? The problem is because the user has not a home folder, and I have no idea how to force pam to create it. –  Lorenzo Nov 10 '11 at 11:05
    
I'm sorry, I'm at the limit of my pam troubleshooting knowledge. If I think of something else I'll definitely post it here. –  Handyman5 Nov 10 '11 at 20:09
    
It's very rare. I had put that line with a debug option, and trying to log with a non local user at gdm fails but if try a local user by cli auth.log says "the user already has a home directory". Any suggestions? –  Lorenzo Nov 14 '11 at 12:58
show 1 more comment

I already notice that the real problem is that accounting/session is failing because the radius user has not an entry at /etc/passwd

I'm currently trying to do adduser by libpam_script.so plugin. Maybe it's the solution ;)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.