Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
Bonjour,
Pourquoi ne pas utiliser/packager le logiciel LAPS de chez Microsoft pour le changement de mot de passe des comptes locaux ? (https://www.microsoft.com/en-us/download/details.aspx?id=46899).
Vous pouvez définir ensuite par GPO, le compte à gérer, le délai et la complexité de celui-ci.
Cordialement,
http://www.cnrs.fr/https://www.lcc-toulouse.fr *Jérôme COLOMBET | IT Manager | RICS* CNRS Laboratoire de Chimie de Coordination (LCC) - UPR 8241 205 route de Narbonne - BP44099 - 31077 TOULOUSE Cedex 4 +33 561 333 107 | jerome.colombet@lcc-toulouse.fr mailto:jerome.colombet@lcc-toulouse.fr Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
J'utilise un simple run pour ça:
run(r'net user dani /add', accept_returncodes=[0,2])
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Là encore, un simple run peut le faire
run('net user dani %s'% variables['pass'])
Par contre, il faut prendre des précautions pour que ce mot de passe ne soit pas visible en clair dans le paquet. Dans mon cas, je déploie un paquet contenant des variables (une structure YAML) chiffrées, et je déploie sur chaque poste la clé symétrique nécessaire à leur lecture. Quelque chose comme :
1. # Read local variables file if available 2. if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): 3. print('Reading local encrypted variables file') 4. from cryptography.fernet import Fernet 5. import yaml 6. f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
7. variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))
Bonjour,
J’avais fait un package ultra crado pour créer ou bien réactiver le compte Administrateur local des postes…
def install():
run('net user Administrateur SuperPassword') run('net user Administrateur /active:yes')
Je risque de me faire taper sur les doigts car je n’utilise aucun des python helpers fournies par Wapt mais bon…le package fonctionne et c’est déjà ça… ;-)
De : WAPT wapt-bounces@lists.tranquil.it De la part de Daniel Berteaud Envoyé : dimanche 7 avril 2019 11:53 À : wapt@lists.tranquil.it Objet : Re: [Wapt] Création d'un utilisateur
Le 06/04/2019 à 18:32, Patrick Perrier a écrit : Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
J'utilise un simple run pour ça:
run(r'net user dani /add', accept_returncodes=[0,2])
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Là encore, un simple run peut le faire
run('net user dani %s' % variables['pass'])
Par contre, il faut prendre des précautions pour que ce mot de passe ne soit pas visible en clair dans le paquet. Dans mon cas, je déploie un paquet contenant des variables (une structure YAML) chiffrées, et je déploie sur chaque poste la clé symétrique nécessaire à leur lecture. Quelque chose comme :
1. # Read local variables file if available 2. 3. if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): 4. 5. print('Reading local encrypted variables file') 6. 7. from cryptography.fernet import Fernet 8. 9. import yaml 10. 11. f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) 12. 13. variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))
Un exemple de gestion de mot de passe "à la laps" avec WAPT où le mot de passe aléatoire généré sur le poste est remonté chiffré par la clé publique de l'administrateur dans le log d'installation du paquet :
* https://wapt.lesfourmisduweb.org/details-package?package=smp-laps-made-in-wa...
Pour changer le mot de passe de façon sécurisée, deux possibilités :
* laisser le poste choisir son mot de passe (aléatoire) et le chiffrer avec la clé publique de l'administrateur wapt pour le remonter au serveur (dans le log d'installation comme ci-dessus) * ou chiffrer le mot de passe à appliquer sur le poste avec la clé publique du poste (on a cette information dans la base de données), et déchiffrer localement lors de l'installation. Dans ce cas on stocke le mot de passe à appliquer dans un fichier (par exemple json) dans le paquet avec une entrée par machine (car chaque machine a sa propre clé).
voir les fonctions waptcrypto.SSLPrivateKey.decrypt() et waptcrypto.SSLCertificate.encrypt()
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
J'ajoute que l'avantage du paquet tis-laps-made-in-wapt c'est que seul le détenteur de la clé privée peut récupérer le mot de passe. Contrairement au laps microsoft qui stocke les mots de passe en clair dans l'ad, wapt fonctionne avec de la crypto.
C'est une alternative intéressante d'un point de vue sécurité.
Nous comptons intégrer nativement ce type de fonctionnement à l'avenir dans WAPT.
Le mot de passe peut ensuite être changé à la demande avec un audit par exemple.
Simon
Le 08/04/2019 à 09:25, Hubert TOUVET a écrit :
Un exemple de gestion de mot de passe "à la laps" avec WAPT où le mot de passe aléatoire généré sur le poste est remonté chiffré par la clé publique de l'administrateur dans le log d'installation du paquet :
Pour changer le mot de passe de façon sécurisée, deux possibilités :
- laisser le poste choisir son mot de passe (aléatoire) et le chiffrer avec la clé publique de l'administrateur wapt pour le remonter au serveur (dans le log d'installation comme ci-dessus)
- ou chiffrer le mot de passe à appliquer sur le poste avec la clé publique du poste (on a cette information dans la base de données), et déchiffrer localement lors de l'installation. Dans ce cas on stocke le mot de passe à appliquer dans un fichier (par exemple json) dans le paquet avec une entrée par machine (car chaque machine a sa propre clé).
voir les fonctions waptcrypto.SSLPrivateKey.decrypt() et waptcrypto.SSLCertificate.encrypt()
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
Merci pour toutes vos réponses.
J'ai maintenant quelques pistes à creuser.
Le 08/04/2019 à 14:30, Simon FONTENEAU a écrit :
J'ajoute que l'avantage du paquet tis-laps-made-in-wapt c'est que seul le détenteur de la clé privée peut récupérer le mot de passe. Contrairement au laps microsoft qui stocke les mots de passe en clair dans l'ad, wapt fonctionne avec de la crypto.
C'est une alternative intéressante d'un point de vue sécurité.
Nous comptons intégrer nativement ce type de fonctionnement à l'avenir dans WAPT.
Le mot de passe peut ensuite être changé à la demande avec un audit par exemple.
Simon
Le 08/04/2019 à 09:25, Hubert TOUVET a écrit :
Un exemple de gestion de mot de passe "à la laps" avec WAPT où le mot de passe aléatoire généré sur le poste est remonté chiffré par la clé publique de l'administrateur dans le log d'installation du paquet :
Pour changer le mot de passe de façon sécurisée, deux possibilités :
- laisser le poste choisir son mot de passe (aléatoire) et le chiffrer avec la clé publique de l'administrateur wapt pour le remonter au serveur (dans le log d'installation comme ci-dessus)
- ou chiffrer le mot de passe à appliquer sur le poste avec la clé publique du poste (on a cette information dans la base de données), et déchiffrer localement lors de l'installation. Dans ce cas on stocke le mot de passe à appliquer dans un fichier (par exemple json) dans le paquet avec une entrée par machine (car chaque machine a sa propre clé).
voir les fonctions waptcrypto.SSLPrivateKey.decrypt() et waptcrypto.SSLCertificate.encrypt()
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
Si tu utilise un AD avec gpo il me semble préférable de faire ces changement par gpo via
Configuration ordinateur -> préférences -> paramètres du panneau de configuration -> Utilisateurs et groupes locaux
Si l'usage des gpo n'est pas possible tu pourrais en effet passer par wapt
changer un mot de passe en ligne de commande : net user <nom de l'utilisateur> <nouveau mot de passe>
Joël LATIEULE - 06.38.02.33.27 / TICE
Collège Victor Hugo - 0110021n 5 boulevard Marcel Sembat, 11100 Narbonne 04.68.90.24.00
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
La solution parfaite pour la gestion des mots de passe des comptes admin locaux est* LAPS* ( sur les domaines avec AD microsoft) C'est une solution microsoft qui s'installe sur l'AD (modification du schéma) et qui permet de faire remonter dans l'AD le mots de passe du compte administrateur. Tout ce configure et ce fait très simplement. C'est une très bonne pratique, il y a grosso modo deux paramètres:
- Les comptes users qui seront impactés par cette règle (administrateur/admuser etc... ce que tu veux) - La complexité des mots de passe ex: 8 caractere, lettre min/maj/chiffre renouvellement toutes les X heures /jours
Je pense que c'est une bonne piste si tu as un AD microsoft https://www.it-connect.fr/securite-proteger-les-comptes-administrateur-local...
*Cordialement*
[image: Logo] https://www.homair.com [image: Logo]
Benjamin RIVERE Administrateur Système et Réseau T: + 33 (0)4 42 95 77 70 | M: + 33 (0)6 42 23 53 59 E: benjaminrivere@homair.com | www.homair.com 570 avenue du Club Hippique | 13090 Aix-en-Provence [image: Facebook icon] https://www.facebook.com/homair [image: LinkedIn icon] https://www.linkedin.com/company/homair/?originalSubdomain=fr [image: Twitter icon] https://twitter.com/CampingHomair [image: Youtbue icon] https://www.youtube.com/user/HomairVacances [image: Instagram icon] https://www.instagram.com/homairvacances/
*Pour toute demande de support merci d’écrire à support-informatique@homair.com support-informatique@homair.com*
*Prise en main à distance: Team Viewer 12 QS https://download.teamviewer.com/download/version_12x/TeamViewerQS.exe*
Le lun. 8 avr. 2019 à 13:16, Latieule Joel joel.latieule@ac-montpellier.fr a écrit :
Si tu utilise un AD avec gpo il me semble préférable de faire ces changement par gpo via
Configuration ordinateur -> préférences -> paramètres du panneau de configuration -> Utilisateurs et groupes locaux
Si l'usage des gpo n'est pas possible tu pourrais en effet passer par wapt
changer un mot de passe en ligne de commande : net user <nom de l'utilisateur> <nouveau mot de passe>
Joël LATIEULE - 06.38.02.33.27 / TICE
Collège Victor Hugo - 0110021n 5 boulevard Marcel Sembat, 11100 Narbonne 04.68.90.24.00
Le 06/04/2019 à 18:32, Patrick Perrier a écrit :
Bonjour,
J'essaie de faire un paquet pour créer un utilisateur avec la fonction create_user.
Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si un compte existe ?
Est-il possible de changer le mot de passe d'un utilisateur avec un paquet ? (Car j'ai un compte local identique sur toutes les machines et j'aimerais changer son mot de passe de temps en temps)
Merci d'avance,
Cordialement
Patrick Perrier
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt
Je rajoute que LAPS n'est pas que disponible pour Microsoft Active Directory. LAPS est aussi disponible avec Samba Active Directory. On le sait car la fonctionnalité a été financée par les Ministères Français et Tranquil IT.
MSAD n'est plus le seul "kid on the block", et sauf pour des fonctions très avancées et très spécifiques que même pas 0,01% des entreprises emploient, Samba-AD est au même niveau fonctionnel que MSAD.
D'ailleurs, ceux qui sont en MSAD2008 et qui voient arriver les devis Microsoft pour passer à un AD plus récent du fait de la fin de vie de win7 et win2008, vous avec de belles économies à réaliser à choisir l'alternative.
Bonne semaine à tous.
Vincent
Le 08/04/2019 à 13:24, Benjamin RIVERE a écrit :
La solution parfaite pour la gestion des mots de passe des comptes admin locaux est/*LAPS*/ ( sur les domaines avec AD microsoft) C'est une solution microsoft qui s'installe sur l'AD (modification du schéma) et qui permet de faire remonter dans l'AD le mots de passe du compte administrateur. Tout ce configure et ce fait très simplement. C'est une très bonne pratique, il y a grosso modo deux paramètres:
- Les comptes users qui seront impactés par cette règle (administrateur/admuser etc... ce que tu veux)
- La complexité des mots de passe ex: 8 caractere, lettre min/maj/chiffre renouvellement toutes les X heures /jours
Je pense que c'est une bonne piste si tu as un AD microsoft https://www.it-connect.fr/securite-proteger-les-comptes-administrateur-local...
**
*Cordialement*
Logo https://www.homair.com Logo
Benjamin RIVERE Administrateur Système et Réseau T: + 33 (0)4 42 95 77 70| M: + 33 (0)6 42 23 53 59 E: benjaminrivere@homair.com mailto:benjaminrivere@homair.com| www.homair.com http://www.homair.com 570 avenue du Club Hippique| 13090 Aix-en-Provence Facebook icon https://www.facebook.com/homair LinkedIn icon https://www.linkedin.com/company/homair/?originalSubdomain=fr Twitter icon https://twitter.com/CampingHomair Youtbue icon https://www.youtube.com/user/HomairVacances Instagram icon https://www.instagram.com/homairvacances/
*Pour toute demande de support merci d’écrire à support-informatique@homair.com mailto:support-informatique@homair.com
*Prise en main à distance: /Team Viewer 12 QS https://download.teamviewer.com/download/version_12x/TeamViewerQS.exe/*
Le lun. 8 avr. 2019 à 13:16, Latieule Joel <joel.latieule@ac-montpellier.fr mailto:joel.latieule@ac-montpellier.fr> a écrit :
Si tu utilise un AD avec gpo il me semble préférable de faire ces changement par gpo via Configuration ordinateur -> préférences -> paramètres du panneau de configuration -> Utilisateurs et groupes locaux Si l'usage des gpo n'est pas possible tu pourrais en effet passer par wapt changer un mot de passe en ligne de commande : net user <nom de l'utilisateur> <nouveau mot de passe> Joël LATIEULE - 06.38.02.33.27 / TICE Collège Victor Hugo - 0110021n 5 boulevard Marcel Sembat, 11100 Narbonne 04.68.90.24.00 Le 06/04/2019 à 18:32, Patrick Perrier a écrit : > Bonjour, > > J'essaie de faire un paquet pour créer un utilisateur avec la fonction > create_user. > > Mon paquet fonctionne si l'utilisateur n'existe pas sur la machine, > mais sinon, j'ai une erreur. Existe t-il une fonction pour tester si > un compte existe ? > > Est-il possible de changer le mot de passe d'un utilisateur avec un > paquet ? (Car j'ai un compte local identique sur toutes les machines > et j'aimerais changer son mot de passe de temps en temps) > > Merci d'avance, > > Cordialement > > Patrick Perrier > > _______________________________________________ > WAPT mailing list > WAPT@lists.tranquil.it <mailto:WAPT@lists.tranquil.it> > http://lists.tranquil.it/listinfo/wapt _______________________________________________ WAPT mailing list WAPT@lists.tranquil.it <mailto:WAPT@lists.tranquil.it> http://lists.tranquil.it/listinfo/wapt
WAPT mailing list WAPT@lists.tranquil.it http://lists.tranquil.it/listinfo/wapt