LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-12-2010, 12:03 PM   #1
jenniekingsland
LQ Newbie
 
Registered: Oct 2008
Posts: 21

Rep: Reputation: 0
Configure radius to run script under different user


Hi,



My startup script for Radius now works so it starts at boot time, the script is in /etc/init.d and looks like this



#!/bin/sh

/usr/local/sbin/radiusd -d /usr/local/var/log/radius/radacct/ -d /usr/local/etc/raddb/



After rebooting radius starts up automatically which is what I want.



However for security I donít want this to run under root, but I want to it run under a user and group called Ďsupportí



I have edited the radius.conf file and added



# for some finer-grained access controls.

#

user = support

group = support



# max_request_time: The maximum time (in seconds) to handle a request.



So this is to get radius to run under support.



If I run radiusd ĖX from command line as user support, radius starts up fine.



However if I run the startup script as user support from /etc/init.d by entering #./start-my-radius.sh it comes up with error

upport@OXC-RPROXY-02:/etc/init.d$ ./start-my-radius.sh

radiusd: Cannot initialize supplementary group list for user support: Operation not permitted



I guess its something to do with permissions but I canít figure out what I need to change? I just want this to work under user support, if Iím logged in as root and run #./start-my-radius.sh it works fine and starts up radius. However I have to amend radius.conf to get this to work via root login so it looks like this

#user = support

#group = support





So what have I missed?



The radius files look like this



support@OXC-RPROXY-02:/usr/local/sbin$ ls -l

total 780

-rwxr-xr-x 1 support support 36403 Oct 12 13:57 checkrad

-rwxr-xr-x 1 support support 619724 Oct 12 13:57 radiusd

-rwxr-xr-x 1 support support 115567 Oct 12 13:57 radmin

-rwxr-xr-x 1 support support 1285 Oct 12 13:57 radwatch

-rwxr-xr-x 1 support support 2471 Oct 12 14:22 rc.radiusd

-rwxr-xr-x 1 support support 2506 Oct 12 14:22 rc.radiusdbkp

support@OXC-RPROXY-02:/usr/local/sbin$



This is what it looks like when the script starts via root



support@OXC-RPROXY-02:/etc/init.d$ ps aux | grep radiusd

root 30712 0.0 0.2 47080 2744 ? Ssl 15:55 0:00 /usr/local/sbin/radiusd -d /usr/local/var/log/radius/radacct/ -d /usr/local/etc/raddb/

support 32505 0.0 0.0 2184 736 pts/0 S+ 15:57 0:00 grep radiusd



OXC-RPROXY-02:/etc/init.d# cd /usr/local/sbin

OXC-RPROXY-02:/usr/local/sbin# ls -l

total 780

-rwxr-xr-x 1 support support 36403 Oct 12 13:57 checkrad

-rwxr-xr-x 1 support support 619724 Oct 12 13:57 radiusd

-rwxr-xr-x 1 support support 115567 Oct 12 13:57 radmin

-rwxr-xr-x 1 support support 1285 Oct 12 13:57 radwatch

-rwxr-xr-x 1 support support 2471 Oct 12 14:22 rc.radiusd

-rwxr-xr-x 1 support support 2506 Oct 12 14:22 rc.radiusdbkp



Please help!
 
Old 10-12-2010, 04:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Well you can easily run a service via su within your script, but why are you not using a standard sysVinit script to do this anyway? I'd really recommend using a proper service script rather than writing your own unless you really have specific requirements that genuinely aren't served any other way. If you've installed this from source, you'll often find that example init scripts are available within the source release, or alternatively it's often trivial to modify an existing script for a different service to do what you need. No need to start from scratch.
 
Old 10-12-2010, 04:29 PM   #3
jcmlq
Member
 
Registered: Aug 2009
Posts: 32

Rep: Reputation: 19
What permissions are on /etc/group and to what groups does the support user belong?

You might try commenting out just the 'group = support' line.
 
Old 10-12-2010, 10:21 PM   #4
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
I guess the 'support' user must owned /usr/local/etc/raddb/, /usr/local/var/log/radius/radacct/, ... (all configuration files, log files, ...). Therefore, I suggest you re-compile FreeRADIUS with --prefix=/usr/local/radius and make this folder owned by support:support. Try again and let me know if this help.

As acid mentioned, you should use standard SysV init script.
 
Old 10-13-2010, 07:33 AM   #5
jenniekingsland
LQ Newbie
 
Registered: Oct 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Hi

The permissions for /etc/group look like this

-rw-r--r-- 1 root root 756 Oct 12 11:56 group
support:x:1000:
support:x:1000:1000:support,,,:/home/support:/bin/bash

I've tried using the proper service script which came from the source, that again runs fine under root but if i try to get the user support run it i get the same message.

I tried commenting ut the 'group - support' line but again get exactly the same mesage.

I just want this script to run under the user support and also for when the box is rebooted it starts up radius but under the user 'root'

I am not sure how to enter the su but in my sript? This is a bit new to me, do i just need to enter su - support before my script and willi need to enter the password? I guess I need to edit the sudeors file too?

thans
 
  


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
run radius server as a more right user tanoatlq Slackware 1 05-22-2008 03:46 AM
Need to configure mailman rpm to run as different user devhen Red Hat 3 06-23-2006 08:22 PM
How to run/configure job for other user from root nikhil_rs_maheshwari Solaris / OpenSolaris 2 03-24-2006 04:36 AM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 08:54 AM
Yet another configure script that won't run gauge73 Linux - Newbie 1 02-14-2004 03:25 PM


All times are GMT -5. The time now is 02:28 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration