Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
After going through many hurdles to get my wireless card working I can finally access my LAN and the Internet when logged in as root after using a startup script to set the network settings. However, when I login to my normal user account after a restart I can't access anything. I can su to root, run the script, then su back to access the net, but this won't work when I switch to using Linux as my main system and have multiple users. I have tried to run the script as a standard user, but it won't work. Here's the script contents:
ifconfig eth0 192.168.0.101 mtu 576
iwconfig eth0 mode managed channel 6 rate 22M essid WAP1
iwconfig eth0 key 5a22-7b9c-62 essid WAP1iwconfig eth0 mode managed channel 6 rate 22M essid WAP1
iwconfig eth0 key 5a22-7b9c-62 essid WAP1route add default gw 192.168.0.1
The script will work fine when I run it as root, but when I try it as a user this is what it outputs:
bash: ifconfig: command not found
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
SET failed on device eth0 ; Operation not permitted.
bash: route: command not foundIs there a way to let a user run this script without the errors? Or better yet automatically at startup or user login?

Have you tried to add the settings to
'/etc/sysconfig/network-scripts/' and/or modifying '/etc/rc.d/init.d/network' script? This should solve your problem.

All of the settings are in the ifcfg-eth0 file, here's what I got:
NAME=WiFi
WIRELESS=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
MTU=576
ONBOOT=yes
MODE=ManagedCHANNEL=6
RATE=22M
KEY=5a22-7b9c-62
ESSID=WAP1
USERCTL=yesAs can be seen, all the settings are there, and are correct. They just don't all seem to stick between boot and login. And the device is being started at boot time.
The other thing is that my routing table doesn't save between reboot, which is why the route command is in my script.
Also, the driver/card, seems to pick up a different WAP than mine when it starts up, as is evident when looking at the iwconfig output before I use my script. Any ideas?

I have a possible solution to my problem, but it relies on the .rc or .login file as so named in unix. I can't find either of these files in Mandrake 9.1. What would be the names of these files in Mandrake?

You should have an rc.local file (which is
a bit like autoexec.bat under windoze).
Look in /etc/init.d and /etc/rc.d
You could also write your own rc script and
add it to runlevel 3 and 5 (both
networking)
You could also suid the scripts so that if
a regular user executes it, it runs as
root:
# chmod +s /path/to/script.sh
although this method is not usually
recommended for security reasons, better
would be to use sudo instead.
# man sudo
for more info

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |