Home directory template for new users on IBL servers¶
By C.Du @snail123815
To automatically apply custom home directory template when IPA users first log in to our servers.
FreeIPA uses PAM (Pluggable Authentication Modules) system to manage users, this repository is intended to use its automation processes to achieve our goal.
Repository (private): iblservers home directory setup
Caution
This repository uses git LFS, run git lfs install in the repository directory before proceeding, you may need to install git-lfs package in the system or your environment.
For how to setup in a new server, see Auto home directory setup
Actual execution flow¶
During login, PAM will execute a set of routines, which will include our pam_setup_homedir.sh.
pam_setup_homedir.shwill do several checks and get the user and group name. If the user has no HOME directory, or has no~/.home_initializedflag file, it will callconvert_home_dir.shwith appropriate parameters./home/.home_template/will be used.convert_home_dir.shwill thenMake a copy of
.home_templateMake a copy of existing home directory
Unzip the
vscode-server.tar.xzto.vscode-serverPrepare
.mambarcformicromamba,the cache directory will be created for the userCreate a user directory in shared storage, make a soft link
datain HOMEInitialize
micromambaenvironments for the user, which will create~/.micromambaas the base environment, and setup~/.mambarc.