How to write a process to log root by c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to write a process to log root by c

566 Views
tingning
Contributor II

i want write a process to log root but i don't know how design the process

i hope i can get your help

if you  offer your source code i will Grateful

thanks

2 Replies

471 Views
b36401
NXP Employee
NXP Employee

You can set setUID bit for your binary:

# chown root your_binary

# chmod 4755 your_binary

Then it will be executed with root privelegies.

Have a great day,

Victor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

471 Views
tingning
Contributor II

Hello Victor Linnik!

thank you for reply me  but  I suffer trouble which is like this

for example

ning@ubuntu:/work$ su

Password:

this Password  is required input by system ,

i  don't want to use keyboard, i went use executable file which is Compiled by gcc

please help me

i totally have not way  and come true it!

0 Kudos