Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What am I doing wrong here as this line is making visudo fail

dhiller2 ALL= ALL, !NSHELLS, !NSU NOPASSWD: ALL

this line works

dhiller2 ALL= ALL, !NSHELLS, !NSU

How to fix this?

and yes, I know there are ways to get around this...this is just to remind our admins that policy is not sudo su - and you should be using sudo to run all commands.

thanks, Dean

share|improve this question
    
So, you aim is, that user dhiller2 should be able to run all commands on this machine and shouldn't be asked for the password and sudn't be able to do sudo su -... is that right ? –  GeekRide Dec 22 '12 at 9:01
    
yes, that is correct. –  Dean Hiller Dec 22 '12 at 15:29

2 Answers 2

up vote 2 down vote accepted

Use it like this.

dhiller2 ALL= NOPASSWD: ALL, !NSHELLS, !NSU

It will work. Tested on my machine itself.

share|improve this answer

You need an additional comma after !NSU.

The line below passed visudo but I don't know if it has the effect you want.

dhiller2 ALL= ALL, !NSHELLS, !NSU, NOPASSWD: ALL

share|improve this answer
    
hmmmm, it parses now but now it no longer denies me access to doing "sudo su -" anymore :(. –  Dean Hiller Dec 21 '12 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.