And is there a way to include my root password in there so I don't need to enter it on the next line? sudo --password="applemac" nmap localhost -O kinda thing?
–
JShoeAug 7 '11 at 16:16

If you run this kind of command regularly, you can create a setuid binary that would run as root without asking for the root password. I'm not sure why you would want to do this, however.
–
Sören KuklauAug 7 '11 at 19:15

A more secure way would be to edit /etc/sudoers and add an entry in the form username ALL=(ALL) NOPASSWD: ALL. Setting the setuid bit allows any user on the system to have sudo access.
–
grantcAug 8 '11 at 12:36

That'd be wonderful, if I wasn't trying to make the same thing. :) I'm using these commands to write a GUI in python to show active devices, and if you want, get info. Unfortunately, getting people to install nmap and enter their root password is too much, this'll be just for me.
–
JShoeAug 7 '11 at 16:35

You can ship nmap with your GUI, and you can also ship it with a tool with setuid. It would then only have to prompt for the admin password once.
–
Sören KuklauAug 7 '11 at 19:16