Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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?
Questions about hacking violate the rules of this site. Be gone with you before you get reported.
The question is not about hacking (hacking in the meaning of "do smth that is not legal"). The question is about legal things. I'm asking because I'm newbie in *nix world. Maybee there is a syscall in linux that deal with user privilegues or something else that i don't know.
So is a set-uid executable files the oldest and the only possibility to become root and modern unixes do not have another way?
Drawing out ones intentions is the only and best way to get clarity.
I don't know what you are trying to say here. Please be more direct.
Quote:
Originally Posted by unSpawn
Even then please remain respectful towards your fellow LQ members.
I think he is asking questions about hacking, and I don't think I was disrespectful. I just told him to leave before getting reported. I could have skipped that step and just turned him in. If you really feel I was disrespectful, maybe you should report me.
Of course, you are a moderator, so maybe he reported me, and maybe that's why you are now involved?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.