Way (ways) to change uid of a process
Hello All!
I'm newbie in unixes and in doubt in one question. How we can change a euid of a process? Become a root for example. The only possibility that i found is to exec() suid Program. Owner of the Program must be root. Is it the only way to change euid of a Program? or there is another possibility to change euid of a process to whatever i want. If so can i remove all set-uid-programs from my system? Or set-uid-programs is always the case (necessity) in all unixes? PS sorry for my english. hope you understand the question. |
Quote:
I am pretty sure that would break your system. Some programs use setuid and seteuid to drop all their user privileges and do some unprivileged work. |
yes, my english is awful. I'll try to explain better.
The question is: how a program can get root privileges? One way everybody knows. it is to call exec() function on file that has set-uid bit on and the owner of the file is root, then call setuid(0) and here it is. you are root now. is it the only possibility to get root privileges or there another ones? I'm asking becouse there are so many different technologies (PAM, SELinux, RBAC etc) appeared, so maybe i miss something and the program can get root privileges somehow else? |
Quote:
|
Quote:
So is a set-uid executable files the oldest and the only possibility to become root and modern unixes do not have another way? |
Quote:
|
Quote:
Even then please remain respectful towards your fellow LQ members. |
Quote:
Quote:
Of course, you are a moderator, so maybe he reported me, and maybe that's why you are now involved? |
Quote:
|
Guys, sorry if my question sounds like "hacking". I'm just an electronic and automation engineer and OSS is my hobby. I asked such question on another forums and here I get answers, on others forums i get no answers. so thanks for help.
to David1357: i don't reported you. i even don't know what does it mean... |
I don't fully understand what your after either but possibly something like sudo could help. From the way i undertand it, your trying to run scripts/commands as root but when your a different user. For this 'sudo' is the normal thing to do.
SUID is not something to mess about with unless you fully understand it (same goes for setting sudo permissions). But to execute a script/command as root when not root.... yes you could set the SUID and this will work (if the owner is root), however the same functionality can be gained with sudo.. http://www.linuxhomenetworking.com/w...Users_and_Sudo This is a useful webpage, to get directly to the portion i'm talking about look for in the page the heading 'The /etc/sudoers File'. But you may be better off reading the whole article. It explains quite a lot and this may help you beter understand things. |
All times are GMT -5. The time now is 01:57 AM. |