Web Hosting Talk







View Full Version : Giving a script root permissions ...


hoot
12-04-2001, 07:40 AM
Is it possible to give a script root permissions ...
I have got a script that enables me to edit text files but even if I enter with user : root and password: my root password it doesn't work. Same on telnet: you have to ues the command su to get root access and it would be nice to be able to do it with a script or with ftp ...

jic
12-04-2001, 10:37 AM
You have to setup it up in apache so that it runs as root.. Real stupid move if you do it tho. If I were you I would just chmod 777 the files that you want it to edit / see instead of making anything that doesnt need to be run as root as root.

cperciva
12-04-2001, 11:33 AM
:eek: :eek2: :eek3: :eek4: :bawling: :bawling: :bawling:

Err, bad idea. Both of you.

No offense intended, but I think this falls into the category of "if you have to ask, *don't*."

hoot
12-04-2001, 01:01 PM
Thanks, I wanted to be able to connect to the server as root with a script without changing the apache settings. Like a script that would connect to the server like telnet and su the root by it self and then allow me to modify some text files so I don't have to download them to change them.

Hoot

technoweenie
12-04-2001, 01:58 PM
Hi there,

I am a new to the board..
so I apologize if I am stepping on anyones toes..

Depending on the operating system..
some don't let you connect as root.

Can you change the group setting of the text files in question
and then edit them as a normal [trusted] user ...?

chmod 664 <sometextfiles.txt>
chgrp foo <sometextfiles.txt>

Then your script might be operational...
as long as the owner of the script is in group 'foo'.

bobcares
12-04-2001, 04:05 PM
Hi!
If both the machines have SSH then you can write a c program to work on this script...
Using apache with SUexec and root permission is not a very good idea....

have a great day :)

regards
amar