At this moment i have installed freeradius and PAM radius properly. When i create an account on the system and set a password in /etc/raddb/users.conf the user can login. Sudo also works great with PAM radius.What i want to achieve is when i create a user in /etc/raddb/users.conf and reload the config. That the account and home dir will be created if the authentication for Radius succeeds.I tried many things including session    required    pam_mkhomedir.so skel=/etc/skel/ umask=0022The last log lines from the login without a system user account.Feb 23 18:59:17 localhost sshd[3353]: pam_unix(sshd:auth): check pass; user unknownFeb 23 18:59:18 localhost sshd[3353]: Failed password for invalid user pop from 192.168.0.115 port 53608 ssh2Feb 23 18:59:18 localhost sshd[3353]: Connection closed by 192.168.0.115 [preauth]Feb 23 18:59:18 localhost sshd[3353]: PAM 3 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=danys-mbp.fritz.boxFeb 23 18:59:18 localhost sshd[3353]: PAM service(sshd) ignoring max retries; 4 > 3Feb 23 18:59:18 localhost sshd[3358]: Invalid user pop from 192.168.0.115Feb 23 18:59:18 localhost sshd[3358]: input_userauth_request: invalid user pop [preauth]Feb 23 18:59:21 localhost sshd[3358]: pam_unix(sshd:auth): check pass; user unknownFeb 23 18:59:21 localhost sshd[3358]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=danys-mbp.fritz.boxFeb 23 18:59:22 localhost sshd[3358]: Failed password for invalid user pop from 192.168.0.115 port 53609 ssh2My config for PAM sshd#%PAM-1.0auth       required pam_sepermit.soauth sufficient pam_radius_auth.soauth       substack     password-authauth       include      postlogin# Used with polkit to reauthorize users in remote sessions-auth      optional     pam_reauthorize.so prepare#account    required     pam_nologin.soaccount    include      password-authpassword   include      password-auth# pam_selinux.so close should be the first session rulesession    required    pam_mkhomedir.so skel=/etc/skel/ umask=0022session    required     pam_selinux.so closesession    required     pam_loginuid.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession    required     pam_selinux.so open env_paramssession    required     pam_namespace.sosession    optional     pam_keyinit.so force revokesession    include      password-authsession    include      postlogin# Used with polkit to reauthorize users in remote sessions-session   optional     pam_reauthorize.so prepareIs it possible to create the system account and home directory on login when using freeradius and PAM radius? If so, how does this work?ps : I am using CentOS 7.Edit : I have tried with a bash script to check if the user exists. Then to create it if it does not exist, but this will not work and i do not see any log output for pam_exec.so failing.Edit : radtest tells me the username and password are correct
Freeradius PAM create user and home on login
ssh;sshd;openssh;pam;radius