469,898 Members | 1,408 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Client login to apache as root???

109 100+
Hi... i am trying to do some CGI with apache http server.

I would like to do some simple things such as creating a folder in the server when i login. However.. i found out that when i login i am not a root user. So i wont be able to create any folder due to permission.

Anybody know how to login as root when i login to the server?
Jun 7 '07 #1
9 4068
Motoma
3,237 Expert 2GB
Hi... i am trying to do some CGI with apache http server.

I would like to do some simple things such as creating a folder in the server when i login. However.. i found out that when i login i am not a root user. So i wont be able to create any folder due to permission.

Anybody know how to login as root when i login to the server?
THIS SHOULD NOT BE DONE!

Instead, change the permissions on the folder you wish to have Apache access.
Jun 7 '07 #2
skyy
109 100+
Hi... i need the client to act as root to run some command such as changing the ip address. This require root access..

any idea?
Jun 12 '07 #3
Motoma
3,237 Expert 2GB
Hi... i need the client to act as root to run some command such as changing the ip address. This require root access..

any idea?
Change IP Addresses? You won't be able to access the server afterwards!
Create a shell script that does the work for you. Make this script have the SUID property.

PLEASE READ THE FOLLOWING. I need you to understand the security implications this could have if done improperly.
Dangers of SUID Shell Scripts
Jun 12 '07 #4
skyy
109 100+
Change IP Addresses? You won't be able to access the server afterwards!
Create a shell script that does the work for you. Make this script have the SUID property.

PLEASE READ THE FOLLOWING. I need you to understand the security implications this could have if done improperly.
Dangers of SUID Shell Scripts

Hi thanks.. i managed to do it with SUID...
Jun 12 '07 #5
Motoma
3,237 Expert 2GB
Glad you have found your solution. If you are still worried about security I have devised another way which is likely to be more secure:
Have apache write the desired IP information to a file.
Have a cron script run every minute to check for the file. If it exists, read it and perform the change then delete it.
Jun 12 '07 #6
skyy
109 100+
Glad you have found your solution. If you are still worried about security I have devised another way which is likely to be more secure:
Have apache write the desired IP information to a file.
Have a cron script run every minute to check for the file. If it exists, read it and perform the change then delete it.
Hi.. this seems to be a good solution..

Can show me how to write the script?
Jun 13 '07 #7
Motoma
3,237 Expert 2GB
Hi.. this seems to be a good solution..

Can show me how to write the script?
Haven't tested it, but it would be something like this:

Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. VAR=`cat /var/www/html/ipchange.txt`
  3. ifconfig eth0 down
  4. ifconfig eth0 $VAR
  5. ifconfig eth0 up
  6.  
Jun 13 '07 #8
skyy
109 100+
Haven't tested it, but it would be something like this:

Expand|Select|Wrap|Line Numbers
  1. #!/bin/bash
  2. VAR=`cat /var/www/html/ipchange.txt`
  3. ifconfig eth0 down
  4. ifconfig eth0 $VAR
  5. ifconfig eth0 up
  6.  
Hi thanks.. i meant how to write the cron script to let it check for a file every minute?
Jun 14 '07 #9
Motoma
3,237 Expert 2GB
Hi thanks.. i meant how to write the cron script to let it check for a file every minute?
Yeah, that was the cron script. Take a look at man crontab to see how to set the script to run.
Jun 14 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by John | last post: by
5 posts views Thread by Grant Collins | last post: by
1 post views Thread by ptaz | last post: by
4 posts views Thread by Yasaswi Pulavarti | last post: by
7 posts views Thread by Christian Wilhelm | last post: by
19 posts views Thread by Alex Madon | last post: by
3 posts views Thread by focussys | last post: by
9 posts views Thread by John C. Frickson | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.