Getting a program to start with root privileges when a user logs in.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Getting a program to start with root privileges when a user logs in.
Hey everyone,
I'm trying to get a program to start, not during startup but once a user logs on. The program need to be run with root privileges. I've adding it to rc.local, or init.d but this starts the program during startup whereas I only want it to start after logging in.
I've also put the program in .bashrc or /etc/profile this does the job of loading the program during startup but it's not run by root.
I will try it just now, but I just want to ask does this mean that the user will be able to close the program. Because one of the reasons I want to run the program as root is so that the user cannot close it.
Umm, no they'll be able to close it. That's a different problem then. If you don't get any more responses to this thread, try reposting but use a subject line like "how to make a program persistant".
As I said in another thread, you should be careful to offer setting binaries setuid root unless I. you know (sourcecode, docs or experience) that it is a safe practice and II. there is no workaround.
Joeking, maybe you should explain first what application you want to run setuid root. Maybe there's a workaround.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.