# sudo help

## tom56

I added this line to /etc/sudoers

```
%wheel  ALL=(ALL)       ALL
```

So that those in the wheel group could use sudo.  However, it isn't asking for a password when I run sudo.  Obviously this is very worrying.  Does anyone know why this might be happening?  Thanks,

Tom.

----------

## mpsii

Not entirely sure if this is required or not, but I have always used visudo to edit the /etc/sudoers file rather than manually editing it.

Is that line in the /etc/sudoers file twice and uncommented twice?

----------

## OdinsDream

The file used to have a comment about this "feature." Personally I have it enabled, because I'm stupid and lazy, but I do remember consciously choosing this.

----------

## tom56

```

# sudoers file.

#

# This file MUST be edited with the 'visudo' command as root.

#

# See the sudoers man page for the details on how to write a sudoers file.

#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# User privilege specification

root    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands

%wheel        ALL=(ALL)       ALL

# Same thing without a password

# %wheel        ALL=(ALL)       NOPASSWD: ALL

# Samples

# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

# %users  localhost=/sbin/shutdown -h now

```

Here's my sudoers file.  I edited by doing visudo but it didn't make a difference.

EDIT: Weird.  It's suddenly working again now, even though I haven't done anything.  Thanks for the help anyway!

----------

## mpsii

This is the only difference between my file and yours:

```
# Defaults specification

Defaults targetpw            # ask for the password of the target user i.e. root

%users ALL=(ALL) ALL     # WARNING! Only use this together with 'Defaults targetpw'!
```

----------

## RuiP

Hi,

I cannot use sudo to launch X apps. Is this normal with gentoo?

I always had used sudo to launch leafpad or gedit as root on other distros.

(Now i get this: "Gtk-WARNING **: cannot open display:" error. And gksudo gives me the same after a message windows saying "Child terminated with 1 status")

How can i get that behavier with gentoo? Is possible? just a permission setting or a configuration change?

many thanks for advices.

----------

## humph

 *RuiP wrote:*   

> Hi,
> 
> I cannot use sudo to launch X apps. Is this normal with gentoo?
> 
> I always had used sudo to launch leafpad or gedit as root on other distros.
> ...

 

I had this problem either. 

Solution (without a clue what possible security holes are coming up with this one):

in /etc/sudoers comment out the following line

```
Defaults env_reset
```

Happy hacking!

Humph

----------

## RuiP

 *humph wrote:*   

> 
> 
> Solution (without a clue what possible security holes are coming up with this one):
> 
> in /etc/sudoers comment out the following line
> ...

 

Hi humph,

thanks, for that. I had never seen that line in any sudoers file of none of the linuxs i tried! 

Strange enough is not clear what it does but don't have any coment about It on file...

Any way, the securitty hole seems to be the other way around. Doing su leaves you on command line until you type exit... so is dangerous the sudo, and with gentoo sudo -c gedit somefile, opens gedit but NOT somefile... whitch is unconfortable.

anyway that was your first post and you are answering not question, so,

 congratulations and Welcome.

----------

