Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
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

Your Answer


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.