How to write a process to log root by c

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to write a process to log root by c

1,241 次查看
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 回复数

1,146 次查看
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!

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

1,146 次查看
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 项奖励
回复