$ifdown and up for a user rights
Hello
using testing/2.6.13 is there a way to give a user the rights to #ifdown/ifup a eth0 for my adsl modem/router to pon and poff the Internet connection? somthing like adding a user to a dialup group for pon for example? thanks |
Why don't you try the following:
1. Create a new group for those designated users (in my example, dialup) and add the users to that group. 2. Change the group to which the ifup and ifdown belongs, for example: #chown root:dialup `which ifup`;chown root:dialup 'which ifdown' |
I did all I can but I am not able to use ifup/ifdown as a user, note;
[/home/sam] ls -l !$ ls -l /sbin/if* -rwxr-xr-x 1 root root 58380 Jul 1 05:52 /sbin/ifconfig -rwxr-xr-x 2 root dialout 26400 May 3 2005 /sbin/ifdown -rwxr-xr-x 1 root root 3852 Apr 4 2002 /sbin/ifport -rwxr-xr-x 2 root dialout 26400 May 3 2005 /sbin/ifup -rwxr-xr-x 1 root root 4716 Apr 4 2002 /sbin/ifuser [/home/sam] groups sam sam : sam dialout cdrom floppy audio dip src [/home/sam] exit exit sam@das:~$ ifup eth0 bash: ifup: command not found sam@das:~$ /sbin/ifup eth0 /sbin/ifup: failed to open statefile /etc/network/run/ifstate: Permission denied sam@das:~$ su Password: [/home/sam] ls -l /etc/network/run/ifstate -rw-r--r-- 1 root root 6 Nov 8 20:13 /etc/network/run/ifstate [/home/sam] chown root:dialout /etc/network/run/ifstate [/home/sam] exit exit sam@das:~$ ifup eth0 bash: ifup: command not found sam@das:~$ /sbin/ifup eth0 /sbin/ifup: failed to open statefile /etc/network/run/ifstate: Permission denied sam@das:~$ su Password: [/home/sam] ls -l /etc/network/run/ifstate -rw-r--r-- 1 root dialout 6 Nov 8 20:13 /etc/network/run/ifstate [/home/sam] ifup eth0 connects ok |
Ok... seems good, just check that you changed the ifup group (which is good) but the permissions on /etc/network/run/ifstate are Read-Write for owner (root) but still just read for group (should be Read-Write as well).
|
ok,
I did it but I am having some problems (1) sam@das:~$ /sbin/ifdown eth0 /sbin/ifdown: interface eth0 not configured (2) as root# ifdown eth0 ifdown: interface eth0 not configured addgroup root dialout Adding user `root' to group `dialout'... Done. [~] ifdown eth0 ifdown: interface eth0 not configured [~] /sbin/ifdown eth0 /sbin/ifdown: interface eth0 not configured |
All times are GMT -5. The time now is 07:49 PM. |