You are not logged in.

#1 2008-11-11 17:29:04

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

Making a script run as root

Hi,

I want to start a script as a normal user, and the script to do things, only root can do.

I changed the permission with chmod, they look like this now:
-rwsr-sr--  root ls  ... file-name

But when the script tries to acces a root-only file, I get a "permission denied".

Any adivce?
Thanks!
Nathan

Offline

#2 2008-11-11 17:35:43

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Making a script run as root

you may be better off using sudo


Mr Green

Offline

#3 2008-11-11 17:40:03

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Making a script run as root

I don't think that's possible without using sudo or su. The whole point of not having root privileges is to prevent exactly what you want to do. The only workaround that I can think of would be to create a daemon that's started with root privileges and that can accept some limited commands from a regular user, but I have no idea how you would actually do that.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2008-11-11 18:02:16

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

Re: Making a script run as root

Well, sudo is a good Idea too. Thanks!

Offline

Board footer

Powered by FluxBB