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.

I want to allow a normal user to run NMAP's advanced scans like XMAS, TCP FIN, TCP NULL scans. Can somebody please tell me how to do that ?? Since it uses raw packets so whether setting the setuid bit will work or not ?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes, setuid bit should work fine (unless there is some protection in nmap that does not allow it to run with setuid bit enabled, but I don't think so).

Another possible (and in my opinion, much better) option is to configure sudo to allow certain users to run nmap with some similar configuration in /etc/sudoers:

username ALL = NOPASSWD: /usr/bin/nmap
share|improve this answer
1  
You need to use 'sudo'. While there are specific reasons it won't work with nmap, in general, you can't just make a program setuid and expect it to do the right thing without it even knowing what the right thing is. –  David Schwartz Sep 20 '11 at 7:45
add comment

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.