LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Getting a program to start with root privileges when a user logs in. (https://www.linuxquestions.org/questions/linux-security-4/getting-a-program-to-start-with-root-privileges-when-a-user-logs-in-106698/)

joeking 10-21-2003 09:29 AM

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.

Anybody got any advice.

Thanks.

jkobrien 10-21-2003 10:39 AM

As root, "chmod u+s filename".

But this will only work on binaries, not scripts.

Also be careful about this, you're allowing people to run the program with all the rights of root.

John

joeking 10-21-2003 11:19 AM

Thanks for the help.

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.

Thanks again.

jkobrien 10-21-2003 11:41 AM

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".

Sorry, I'm stumped!

John

unSpawn 10-24-2003 11:47 AM

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.


All times are GMT -5. The time now is 12:05 AM.