Précédent   Forum des professionnels en informatique > Systèmes > Linux > Sécurité
Sécurité Vos questions sur la sécurité sous Linux/Unix
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 24/01/2011, 01h20   #1
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
Par défaut Donner le droit à un utilisateur.

Bonjour tous le monde,
Je veut savoir comment donner le droit à un utilisateur pour lancer une commande.
par exemple /etc/init.d/postgresql start . sans passer en root.

je travail sur centos.

Merci.
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/01/2011, 06h59   #2
Modérateur
 
Avatar de paissad
 
Homme Papa I. DIAKHATE
Étudiant
Inscription : avril 2006
Messages : 601
Détails du profil
Informations personnelles :
Nom : Homme Papa I. DIAKHATE
Âge : 26
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : avril 2006
Messages : 601
Points : 1 417
Points : 1 417
Bonjour,
Il s'agit de 'sudo'. Regarde dans /etc/sudoers
n'oublies pas aussi de faire et de rechercher sur google comment donner des droits privilégés à un utilisateur.

Cordialement,
__________________
Nous n'héritons pas de la terre de nos parents, nous l'empruntons à nos enfants.
Modérateur aux rubriques Linux/Unix et au chat du site.
http://blog.paissad.net
paissad est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/01/2011, 11h29   #3
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
bonjour,
Merci pour la réponse. bon j'ai met le code suivant:
Mais mon-user ne peut encore pas lancer cette commande.
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/01/2011, 14h54   #4
Modérateur
 
Avatar de paissad
 
Homme Papa I. DIAKHATE
Étudiant
Inscription : avril 2006
Messages : 601
Détails du profil
Informations personnelles :
Nom : Homme Papa I. DIAKHATE
Âge : 26
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : avril 2006
Messages : 601
Points : 1 417
Points : 1 417
je cite le manuel de sudoers
Citation:
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 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 overridden via the verifypw and listpw options.
Donc, tu peux faire un truc du genre dans /etc/sudoers

Code :
oracle ALL = NOPASSWD: /etc/rc.d/rc.oracledb
ou bien
Code :
mon-user localhost = NOPASSWD: /etc/init.d/postgres
Voici ce que j'obtiens après test !

Citation:
sudo -l
User oracle may run the following commands on this host:
(root) NOPASSWD: /etc/rc.d/rc.oracledb
Cordialement,
__________________
Nous n'héritons pas de la terre de nos parents, nous l'empruntons à nos enfants.
Modérateur aux rubriques Linux/Unix et au chat du site.
http://blog.paissad.net
paissad est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/01/2011, 16h38   #5
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
Bonjour,
Est ce que je doit redemander un service après cet conf?? parce que ça marche encore pas!!!
si oui le quelle?

Merci
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/01/2011, 17h20   #6
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
est ve qu'il est possible de donner tous les droits à un utilisateur?

Code :
1
2
 
utilisateur1    ALL=(ALL)       ALL
au mois ça marche pas encore chez moi!
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/01/2011, 12h37   #7
Membre Expert
 
Homme
budget et contrôle de gestion
Inscription : décembre 2006
Messages : 894
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 44
Localisation : France

Informations professionnelles :
Activité : budget et contrôle de gestion
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : décembre 2006
Messages : 894
Points : 1 539
Points : 1 539
Salut,

Question idiote mais sudo est installé
__________________
Winnt

C'est en Linuxant qu'on devient .... geek

Intel Core i5 750 / 8 Go ram / Hdd 2 To / NVIDIA GeForce GTS 250 1Go sous Gentoo.
Dual core E6300 / 2Go ram / Hdd 1 To / Ati 9800XT sous Debian Testing.
Atom N330 / 4Go ram / Hdd 5To / intel GMA 950 sous Debian Testing

Ici un article de présentation de la distribution Gentoo http://winnt.developpez.com/tutoriel...tation-gentoo/
Winnt est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/01/2011, 13h32   #8
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
bonjour,
je vois que j'ai tous correcte mais toujours je peut pas mettre mes commandes!!!
Code :
1
2
3
4
5
6
7
8
9
 
sudo -l
Matching Defaults entries for admin on this host:
    requiretty, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG
    LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER
    LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
 
User admin may run the following commands on this host:
    (ALL) NOPASSWD: ALL
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/01/2011, 18h12   #9
Invité de passage
 
Inscription : février 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 11
Points : 0
Points : 0
Code :
1
2
3
4
5
6
7
8
9
10
11
12
 
[admin@ordi ~]$ sudo -l
Matching Defaults entries for admin on this host:
    requiretty, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG
    LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER
    LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
 
User admin may run the following commands on this host:
    (ALL) NOPASSWD: ALL
[admin@ordi ~]$$ cat /etc/sudoers
cat: /etc/sudoers: Permission denied
[admin@ordi ~]$
quelqu'un à une idée de ce que se passe?? pourquoi je n'ai pas les droits root??
bazit38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 04h02.


 
 
 
 
Partenaires

Hébergement Web