start writing main program, finish ssh module, new authnz module, various cleanup
This commit is contained in:
35
modules/authnz.sh
Normal file
35
modules/authnz.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
# Ajout de la gestion d'une authentification centralisé
|
||||
|
||||
export VER_authnz=0.0.1
|
||||
|
||||
# Users (from Ldap)
|
||||
add_users()
|
||||
{
|
||||
backupdist /etc/passwd /etc/shadow /etc/group
|
||||
sed -i -e '/^fatal/d' /etc/passwd /etc/shadow /etc/group
|
||||
echo "+kroot::::::" >> /etc/passwd
|
||||
echo "+kroot::::::::" >> /etc/shadow
|
||||
}
|
||||
|
||||
# Authentication
|
||||
authnz()
|
||||
{
|
||||
pkginst nscd libpam-krb5 libnss-ldap libpam-ldap
|
||||
|
||||
backupdist /etc/krb5.conf /etc/libnss-ldap.conf /etc/pam_ldap.conf \
|
||||
/etc/nsswitch.conf /etc/pam.d/common-session \
|
||||
/etc/pam.d/common-account /etc/pam.d/common-password \
|
||||
/etc/pam.d/common-auth
|
||||
installfile krb5.conf libnss-ldap.conf pam_ldap.conf nsswitch.conf /etc
|
||||
installfile common-session common-account common-password common-auth \
|
||||
/etc/pam.d
|
||||
|
||||
scv_restart nscd
|
||||
|
||||
add_users
|
||||
}
|
||||
|
||||
precheck_authnz()
|
||||
{
|
||||
:
|
||||
}
|
||||
@@ -12,14 +12,8 @@ conf_ssh()
|
||||
|
||||
prnt I "Installation des fichiers de configuration de SSH..."
|
||||
for f in /etc/ssh/ssh{,d}_config; do
|
||||
dest="$f.work"
|
||||
backupdist $f
|
||||
installfile $(basename $f) $dest
|
||||
|
||||
# A finir
|
||||
|
||||
echo "# Generated on $(date --rfc-3339=seconds)" >> $dest &&
|
||||
mv -fv $dest $f
|
||||
installfile $(basename $f) /etc/ssh/$(basename $f)
|
||||
done
|
||||
|
||||
prnt I "Démarrage du sevice ssh..."
|
||||
@@ -28,7 +22,7 @@ conf_ssh()
|
||||
|
||||
precheck_conf_ssh()
|
||||
{
|
||||
# A finir
|
||||
: # Rien à vérifier
|
||||
}
|
||||
|
||||
export -f conf_ssh
|
||||
|
||||
Reference in New Issue
Block a user