TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
IP ändern via CGI

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/9200
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
meinstef



Joined: 25 Jun 2009
Posts: 2

PostPosted: 25.06.2009, 09:37    Post subject: IP ändern via CGI Reply with quote

Hallo,

Ich würde gerne die IP Addresse über ein Webformular im Webserver ändern.
Dazu habe ich ein shell Script (NEW_IP.... sind parameter aus dem formular)
Code:
#!/bin/sh
/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 NEW_IP netmask NEW_MASK
/sbin/route add default gw NEW_GATEWAY
/sbin/ifconfig eth0 up

Jedoch fehlen dem Script die rechte um dies zu tun, auch das Superuser bit hilft hier nichts.
Code:
SIOCSIFFLAGS: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFNETMASK: Permission denied
SIOCADDRT: Operation not

gibt es eine Möglichkeit dem Script die Rechte zu geben dies zu tun? oder eine andere Möglichkeit dies zu tun ?

Gruß
Stefan
Back to top
View user's profile Send private message
ene



Joined: 25 Jun 2007
Posts: 14

PostPosted: 25.06.2009, 16:04    Post subject: Reply with quote

Ja das Superuser bit für scripte ist im Kernel 2.6 abgeschaltet. Eine einfache möglichkeit den Scripten nötige rechte zu geben ist es den Web-Server selber mit root rechten zu starten:
Code:

/usr/local/sbin/thttpd -d /flash/www -c /cgi-bin/* -u root


Damit werden alle ausführbare vom Server gestarteten Scripte mit root rechten laufen.
Es empfielt sich die Scripte in ein extra CGI Verzeichnis zu legen. Gängig ist cgi-bin wie im oberem Beispiel.

Gruß
ene
Back to top
View user's profile Send private message ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> DNP/9200 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015