LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
  Search this Thread
Old 06-17-2005, 04:04 PM   #1
Jake_da_Snake
LQ Newbie
 
Registered: Jan 2004
Posts: 23

Rep: Reputation: 15
Running a service as a user


Similar thread has been posted before but no solid answer.
I'm running a teamspeak server on my gentoo box. Teamspeak comes with a script that can start and stop and restart the server similar to scripts in init.d.
There are two problems with this script.
1. the script must be run from it's directory. If you run it as a link or move it from it's original directory it wont run. This is the minor problem however. I'm not very familiar with scripts but I'm sure there is a way to get around it.

2. The second problem is for security reasons this programs should not be run as a root. So how would you place it in init,d and start it as a different user than root? The SUDO way looks like the hard way to go. I mean apache and ftp and all the other servers dont run as root and they are all on startup.
So what's the easiest way to run services as a user on start up?
Thanks in advance.
 
Old 06-17-2005, 04:22 PM   #2
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Apache and most FTP servers have an option in their config files to be told what user to run as, they are then startes as root by init and then change their uid after they finish any priviledged operations.

Sudo is probably your best bet, Debian has a tool called start-stop-daemon that lets you specify uid, gid, chroot, etc but I don't know if Gentoo has anything similar.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
way to check and see if a service is running nephish Linux - Software 10 02-11-2006 03:36 PM
Running as a service PacMansRancor Linux - Newbie 5 10-24-2005 01:17 PM
How can I tell if a particular service (eth0) is running or not? donJulio Slackware 4 09-21-2005 01:37 AM
irda service up / irattach not running or1onas Linux - Networking 1 03-12-2005 08:52 AM
Running a service at startup correro Linux - General 14 02-18-2003 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:13 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration