LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   $ifdown and up for a user rights (https://www.linuxquestions.org/questions/debian-26/%24ifdown-and-up-for-a-user-rights-380990/)

ekdya 11-08-2005 12:50 AM

$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

avatarfx 11-08-2005 02:08 AM

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'

ekdya 11-08-2005 03:22 AM

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

avatarfx 11-08-2005 03:59 AM

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).

ekdya 11-08-2005 04:33 AM

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 09:51 AM.