LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 10-21-2003, 09:29 AM   #1
joeking
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
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.
 
Old 10-21-2003, 10:39 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
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
 
Old 10-21-2003, 11:19 AM   #3
joeking
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 10-21-2003, 11:41 AM   #4
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
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
 
Old 10-24-2003, 11:47 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,534
Blog Entries: 51

Rep: Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603Reputation: 2603
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give user always root privileges? SimeonV Suse/Novell 18 06-23-2005 11:02 AM
Root privileges for user ar1 Linux - Security 2 01-07-2005 09:33 PM
User with root privileges ShakyJake Linux - Newbie 2 06-18-2004 12:12 PM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 04:27 PM
Giving a User Root Privileges lawrencegoodman Linux - Newbie 4 12-23-2003 04:41 PM


All times are GMT -5. The time now is 08:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration