What exactly is Sudo?

How does Sudo differ from doing a chmod +s <executable>?  How exactly is sudo used...?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

suid allows any user to run the executable, where as sudo is more flexible - you can define groups of users, and groups of executables, and then link them together. So...suid lets anyone run it, but sudo doesn't necessarily do that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
you can type 'man sudo' to get an explanation but in short,

sudo allows non priveledge users root access to run certain apps without having to give them full root access of the root password.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

dissolvedAuthor Commented:
Thanks. I'll check out those links.

Say I want to give root type access to a program firewalk in /usr/bin

the syntax would be

sudo -v -u <username>   ...what else?
here's what I woud do:
run 'visudo' as root
this edit's the /etc/sudoers file

then, at the bottom, you can add lines:
%<linux group name>   <hostname | ALL>=<list of commands>

%trusted ALL=/usr/bin/nmap

will let everyone in the group 'trusted' run nmap from any machine

you can also define user aliases, command aliases, and host name aliases, but in this case I didn't...
sorry...to follow up there, after this has been done, the user can then execute 'sudo nmap' and it will prompt them for their password, and then execute
dissolvedAuthor Commented:
Very cool, thank you
dissolvedAuthor Commented:
quick question. I just did the same thing with ping

now when a regular user does
sudo ping

It just pings. But when they do sudo nmap, it prompts for password.  Why the difference?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.