Linux Sudo Restriction

Posted on August 6, 2008

advertisement

Question: How can I make extra sudo restriction on Linux?

Solutions:
Type: visudo
insert a line
#Disable sudo su -
username ALL=(ALL) ALL, !/bin/su, !/bin/su -, !/bin/su - *
test ALL=(ALL) ALL, !/bin/su, !/bin/su -, !/bin/su - *

#Disable reset root password
username ALL=(ALL) ALL, !/usr/bin/passwd root
test ALL=(ALL) ALL, !/usr/bin/passwd root

#Disable visudo
username ALL=(ALL) ALL, !/usr/sbin/visudo
test ALL=(ALL) ALL, !/usr/sbin/visudo

Save and exit.

Basically you can combine the example as above into single if apply to same username.
For an example:
test ALL=(ALL) ALL, !/bin/su, !/bin/su -, !/bin/su - *, !/usr/bin/passwd root, !/usr/sbin/visudo

Possibly Related Posts:


Comments

Leave a Reply




Planet Malaysia

  • Follow us on Twitter


  • web www.planetmy.com