Run ifconfig without sudo
I have an embedded Linux running on a imx6 platform. This is a freescale embedded linux. The problem is that there is no sudo available for this linux, but I need to activate and deactivate the wlan0 device by a user. I tried to add the user to the group root without any success. I also tried to add the whole command to the /etc/busybox.conf file, but this had no effect either.
How can I run this command as user without having sudo?
user@touch:~$ /sbin/ifconfig eth0 down
SIOCSIFFLAGS: Permission denied
If any non root user would be trusted to do so, you can merely add a setuid flag on ifconfig exec:
chmod 4755 /sbin/ifconfig
It will grant root privilege for execution of this executable to anyone. Of course, you need to have root access to run the chmod.
You don't need to use sudo
to run the ifconfig
command, just make sure that the /sbin
is on your PATH .
as an unprivileged user run:
export PATH=$PATH:/sbin
ifconfig