Configuration de sudo ?[resolut]

bon j’ai fait une config pour sudo ,je connait su la je veux xlimiter le nombre de type de commande a des utilisateur.

donc j’ai ajouter lest utilisateur aux group sudo

puis dans /etc/sudoers
j’ai rajouter les ligne suivante:

# Host alias specification
Host_Alias ICI = localhost
Host_Alias LOCALNET = 192.168.1.*

# User alias spécification
User_Alias ROOT_FRIENDS = tnt
# Cmnd alias specification
Cmnd_Alias SHUTDOWN = /sbin/shutdown, /sbin/halt, /sbin/reboot
# Runas alias specification
# User privilège spécification
# Les amis de root peuvent lancer les commandes
# du groupe SHUTDOWN
ROOT_FRIENDS ICI = SHUTDOWN

seulment sa marche pas il me demande le mots de passe :unamused:

Essaye ceci:

il te faut un NOPASSWD qqpart (man sudoers)
l’ajout des users au groupe sudoers est inutile.

[quote=“mattotop”]il te faut un NOPASSWD qqpart (man sudoers)
l’ajout des users au groupe sudoers est inutile.[/quote]
+1
pour le sans pass :
tt est là :

[code]NOPASSWD and PASSWD

   By default, sudo requires that a user authenticate him or herself before running a command.  This behavior can be
   modified via the NOPASSWD tag.  Like a Runas_Spec, the NOPASSWD tag sets a default for the commands that follow
   it in the Cmnd_Spec_List.  Conversely, the PASSWD tag can be used to reverse things.  For example:

    ray    rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm

   would allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm as root on the machine rushmore as root
   without authenticating himself.  If we only want ray to be able to run /bin/kill without a password the entry
   would be:

    ray    rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm

   Note, however, that the PASSWD tag has no effect on users who are in the group specified by the exempt_group
   option.

   By default, if the NOPASSWD tag is applied to any of the entries for a user on the current host, he or she will
   be able to run sudo -l without a password.  Additionally, a user may only run sudo -v without a password if the
   NOPASSWD tag is present for all a user’s entries that pertain to the current host.  This behavior may be overrid‐
   den via the verifypw and listpw options.

[/code]

Merci pour les réponse :slightly_smiling:

mai ce fichier il faut le crée quelque part je veux bien mai ou ?
s’il contiens le mots de passe il faudrai aux moins le crypter, je suppose.

De quel fichier tu parles ?
tu n’a pas besoin de créer un fichier contenant les mots de passes
pour la base, regarde là linux.chez-beber.net/spip.ph … 3#forum364

Salut.
Si tu veux configurer sudo uniquement pour que tes utilisateurs puissent eteindre ou redemarrer la machine c’est pas la peine de passer par sudoers.Tu peux editer /etc/shutdown.allow :wink:

[quote]je veux xlimiter le nombre de type de commande a des utilisateur.

donc j’ai ajouter lest utilisateur aux group sudo [/quote]
Bon, si tu as des utilisateurs qui font parti du groupe “sudo”, il faut ptet y faire référence ds la ligne, non ?
moi je commencerais la ligne par ‘%sudo’, le %’ évoquant un groupe.
%sudo = SHUTDOWN

bon sudo sa a l’aire trop sensible je laisse tomber.
je me bricolerai un script a placer dans /etc/init.d/ avec l’aide de sensors
:unamused:

Merci pour vos réponse