From bdc04be1f91c54c0eac1998601f72aa30941de19 Mon Sep 17 00:00:00 2001 From: levasseur Date: Fri, 8 Oct 2021 15:41:12 +0200 Subject: [PATCH] authnz: added shell support, added home skelleton, use of long options with adduser --- conf/includes/legos-bas.conf.sh | 3 +++ conf/includes/legos.conf.sh | 3 +++ modules/authnz.sh | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/includes/legos-bas.conf.sh b/conf/includes/legos-bas.conf.sh index 7243bd3..63da2f3 100644 --- a/conf/includes/legos-bas.conf.sh +++ b/conf/includes/legos-bas.conf.sh @@ -11,6 +11,9 @@ export PROXYSRVPORT="3128" export LOCALESET="en_US.UTF-8 fr_FR.UTF-8" export SYSLOCALE="fr_FR.UTF-8" +# Shell par défaut, pour les nouveaux utilisateurs +export DEFAULT_SHELL="/bin/bash" + # Configuration du disque de calcul : zfs, ext4 et xfs accepté #export CALCTYPE="zfs" #export CALCMOUNTPOINT="/calcul/$HOSTNAME" diff --git a/conf/includes/legos.conf.sh b/conf/includes/legos.conf.sh index 9b697fb..a4bfb36 100644 --- a/conf/includes/legos.conf.sh +++ b/conf/includes/legos.conf.sh @@ -14,6 +14,9 @@ export APT_SOURCE_LIST="ubuntu_focal.list" export LOCALESET="en_US.UTF-8 fr_FR.UTF-8" export SYSLOCALE="fr_FR.UTF-8" +# Shell par défaut, pour les nouveaux utilisateurs +export DEFAULT_SHELL="/bin/bash" + # Configuration du disque de calcul : zfs, ext4 et xfs accepté export CALCTYPE="zfs" export CALCMOUNTPOINT="/calcul/$HOSTNAME" diff --git a/modules/authnz.sh b/modules/authnz.sh index ad95c27..6e0f38f 100644 --- a/modules/authnz.sh +++ b/modules/authnz.sh @@ -11,9 +11,10 @@ # * WITH_LDAP_KERB: Shall we install requirements for LDAP/Kerberos auth ? # * REMOTE_USERS: List of remote users to add # * LOCAL_USERS: List of local users to create +# * DEFAULT_SHELL: The shell to use when creating new users # ------------------------------------------------------------------------------ -export VER_authnz=0.1.2 +export VER_authnz=0.1.3 export DEP_authnz="upgrade_dist" # Users (from Ldap) @@ -30,7 +31,7 @@ create_user() { if [[ $(noerror --noout id $1) != 0 ]]; then prnt I "Création de l'utilisateur $1 ..." - useradd -Um $1 + useradd --create-home --skel --shell $DEFAULT_SHELL --user-group $1 else prnt W "L'utilisateur $1 existe déjà. Rien à faire..." fi