Some compilers under the Linux system need root privileges to run if they use raw sockets, but they can't be elevated when the program is running. What should I do at this time? Here's how to run the compiler with root privileges without the need to add sudo or switch to the # prompt.
following steps:
1, complete with root privileges gcc;
2, chmod u + s "executable"
This At the same time, it can be run like Linux's own ping, without sudo or switching to the # prompt.
Of course, since the ping source on UNP uses setuid(getuid()) after creating the original socket, the principle of least privilege is maintained.
The above two steps are indispensable. Just follow the method described in this article, you can run your own compiled program with root privileges under Linux system.
If you dont understand the Linux system to replace files, it is easy to cause text
Through the history command under Linux, we can view the used commands, that is, th
Linux system can use the command line to perform various operations compared with other systems, whi
Firefox is a browser that users like very much on Linux systems, but Firefox often has garbled chara
Ubuntu System Installation Tutorial How to Install Ubuntu System
How to open a file in a terminal using Linux commands
Linux change 22 port method summary
How to install OpenOffice on Linux system
How CentOS 6 modifies disk quota limits
CentOS closes Ctrl+Alt+Del to restart shortcuts
Linux blocking browser request alert method on browser
How to install and use Vsftp in Centos system
What should I do if the Shell command cannot be used after the Linux system is installed?
Solve the problem of Win8 main interface IE flashback
Win10 sets the file type associated with Internet Explorer
A trick to the Windows7 dual hard drive automatically shut down the ills
How to switch the direction of the computer screen of Win7 system?
Background daemon under Linux system
What should I do if the win7 desktop shortcut is missing?
Passed Windows Blue has been developed half
Windows 7 excellent feature analysis
Modify the GHO part of the Ghost operating system file information