Page 1 sur 2

[Résolu][Sudoers] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : jeu. 15 déc. 2022, 21:21
par Breizil29
Bonjour à tous,

Ma configuration de /etc/sudoers est modifié par visudo en root au niveau de : %wheel ALL=(ALL) NOPASSWD: ALL
J'ai une de mes install de Arch qui fait de la résistance et poutant j'utilse toujours le même guide d'installation.
J'aimerais comprendre ce qui ne vas pas

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : jeu. 15 déc. 2022, 22:22
par benjarobin
Bonjour,
Je ne vois pas le lien entre %wheel ALL=(ALL) NOPASSWD: ALL et le fichier /etc/pacman.conf
Une telle ligne devrait être placé dans le fichier / dossier sudoers

Note : La ligne %wheel ALL=(ALL) NOPASSWD: ALL enlève toute sécurité. Je déconseille vivement de faire une telle chose avec sudo

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : jeu. 15 déc. 2022, 22:45
par papajoke
bonjour

Génial ton guide :mrgreen:
Tu peux voir à quel paquet appartient ton fichier

Code : Tout sélectionner

pacman -Qo /etc/le_fichier
réinstaller ce paquet va créer le même fichier avec l'extension ".pacnew" qui est l'original archlinux

Il ne te reste qu'à corriger le mauvais fichier suivant le .pacnew

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 09:28
par Breizil29
Benjarobin a dit :
Je ne vois pas le lien entre %wheel ALL=(ALL) NOPASSWD: ALL et le fichier /etc/pacman.conf
Désolé, je voulais dire /etc/sudoers évidemment.
Benjarobin a dit :
Note : La ligne %wheel ALL=(ALL) NOPASSWD: ALL enlève toute sécurité. Je déconseille vivement de faire une telle chose avec sudo
Je sais, c'est ce que je veux.

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 16:13
par benjarobin
Et donc c'est quoi le problème ? Peux tu détailler ?

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 17:17
par Breizil29
Décidemment ma description du problème est vraiment pourri, ce qui ne vas pas est qu'on me demande tjs mon MP

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 19:00
par benjarobin
Depuis ton utilisateur, quelle est la sortie de la commande : id
Ou dit autrement est ce que tu es dans le groupe wheel ?

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 19:31
par Breizil29

Code : Tout sélectionner

id  
uid=1000(gg) gid=1000(gg) groups=1000(gg),998(wheel)
Je vourais que ce soit comme ça :

Code : Tout sélectionner

 id
uid=1000(gg) gid=1000(gg) groups=1000(gg),3(sys),19(log),982(rfkill),985(video),987(storage),991(lp),994(input),996(audio),998(wheel),999(adm)
Je connais que :
useradd -m -G audio,video,input,wheel,sys,log,storage,rfkill,lp,adm -s /bin/zsh gg
Et évidemment ça ne marche pas car c'est pour créer et moi je veux ajouter ce qui manque par rapport a la deuxième ligne.

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 20:29
par benjarobin

Code : Tout sélectionner

usermod -aG groupe1,groupe2 user
Et si sudo demande toujours le mot de passe pour l'utilisateur "gg", peux tu donner l'intégralité de ton fichier sudoers

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 20:42
par Breizil29

Code : Tout sélectionner

Root gg # usermod -aG groupe1,groupe2 user
usermod: group 'groupe1' does not exist
usermod: group 'groupe2' does not exist
Archlinux gg # q
exit
 gg  ~  usermod -aG groupe1,groupe2 user                               
usermod: group 'groupe1' does not exist
usermod: group 'groupe2' does not exist

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 20:51
par benjarobin
Euh, c’était un exemple...

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 20:58
par Breizil29

Code : Tout sélectionner

## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias    WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users.  These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias    ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands.  Often used to group related commands together.
# Cmnd_Alias    PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
#                           /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias    REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
   ## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file.  Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods.  Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##                                                  
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
## Sudo will create up to 2,176,782,336 I/O logs before recycling them.
## Set maxseq to a smaller number if you don't have unlimited disk space.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output
# Defaults maxseq = 1000

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL:ALL) ALL

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL:ALL) ALL

## Same thing without a password
%wheel ALL=(ALL:ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL:ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL:ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d


Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 21:10
par Breizil29
Euh, c’était un exemple...
Ok laisse tombé pour l'instant je vais essayé tous seul de faire ce que je veux

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 21:33
par Breizil29

Code : Tout sélectionner

 gg  ~  id
uid=1000(gg) gid=1000(gg) groups=1000(gg),3(sys),19(log),982(rfkill),985(video),987(storage),991(lp),994(input),996(audio),998(wheel),999(adm)
ça c'est bon, mais même après redémarrage il me demande tjs mon MP

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 22:13
par benjarobin
Peux tu faire ceci, et en donner la sortie (en root) :

Code : Tout sélectionner

ls -la /etc/sudoers /etc/sudoers.d
curl -F'file=@/etc/sudoers' -Fexpires=72 https://0x0.st
cat /etc/sudoers.d/* | curl -F 'file=@-' -Fexpires=72 https://0x0.st
id gg
Il te demande ton mot de passe quand tu fait sudo -i ?

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 22:44
par Breizil29
Il te demande ton mot de passe quand tu fait sudo -i ?
Non yay ou paru

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 22:49
par benjarobin
Peux tu donner la sortie des commandes demandées, cela pourrait aider. Tu exécutes yay avec ton utilisateur gg ?
Peux tu vraiment expliquer en détail ton problème, car depuis le début j'essaye de deviner, savoir que sudo fonctionne mais avec yay non cela peut aider. Donc si tu as d'autres détails, sorties intéressantes à donner...

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 22:54
par Breizil29

Code : Tout sélectionner

[u]Archlinux gg #[/u] ls -la /etc/sudoers /etc/sudoers.d
-r--r----- 1 root root 3317 Dec 16 21:29 /etc/sudoers

/etc/sudoers.d:
total 12
drwxr-x---  2 root root 4096 Dec  6 10:35 .
drwxr-xr-x 83 root root 4096 Dec 16 21:35 ..
-r--r-----  1 root root   17 Dec  6 10:35 00_gg
[u]Archlinux gg # [/u]curl -F'file=@/etc/sudoers' -Fexpires=72 https://0x0.st
https://0x0.st/onDv.txt
[u]Archlinux gg #[/u] cat /etc/sudoers.d/* | curl -F 'file=@-' -Fexpires=72 https://0x0.st
https://0x0.st/onDw.txt
[u]Archlinux gg #[/u] id gg
uid=1000(gg) gid=1000(gg) groups=1000(gg),3(sys),19(log),999(adm),998(wheel),996(audio),994(input),991(lp),987(storage),985(video),982(rfkill)

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 23:20
par Breizil29

Code : Tout sélectionner

Tu exécutes yay avec ton utilisateur gg ?
Oui yay alias de yay -Syu
Et avec sudo pacman -Syu, c'est pareil or que sur mes 3 autres install je fais les mise à jour sans problème et sans MP

Re: [Pacman.conf] %wheel ALL=(ALL) NOPASSWD: ALL

Publié : ven. 16 déc. 2022, 23:21
par benjarobin
Supprime le fichier 00_gg et dis moi si cela améliore les choses. Ce fichier est inutile.