formats

Suse | sudo asks for root password

Published on July 25, 2012, by + in linux, sysadmin.




By default, the sudo command on Suse Linux asks for the root password instead of the user’s password. I’ll show you how to fix that to be more expected (and secure!) behavior of sudo and only ask for the user’s password.



1. Crack open a terminal, and issue:

$ sudo visudo




2. Comment out the following two lines with a hash tag:

Defaults targetpw   # ask for the password of the target user i.e. root
ALL	ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!





Before:

# In the default (unconfigured) configuration, sudo asks for the root password.
# This allows use of an ordinary user account for administration of a freshly
# installed system. When configuring sudo, delete the two
# following lines:
Defaults targetpw   # ask for the password of the target user i.e. root
ALL	ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

After:

# In the default (unconfigured) configuration, sudo asks for the root password.
# This allows use of an ordinary user account for administration of a freshly
# installed system. When configuring sudo, delete the two
# following lines:
# Defaults targetpw   # ask for the password of the target user i.e. root
# ALL	ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL




3. Now sudo operates properly:

jsmith@suse:~> sudo -s
jsmith's password:
suse:/home/jsmith # 




One Response

  1. Rahul

    Thanks that helps alot :-) u rockzzzzzz :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Home linux Suse | sudo asks for root password