How do you use ifup and ifdown while not at console?

How do you use ifup and ifdown while not at console?

Post by e.. » Sun, 31 Dec 1899 09:00:00



I have a Linux computer on my network that connects my network to the
internet. I would like to be able to activate and deactivate the
connection (by using ifup ppp1 or ifdown ppp1) from another computer
on my network from which I am logged onto my Linux box through an
X-Windows session. I keep getting messages that say that users cannot
do this. I tried changing permissions, but I still cannot do it. Is
there any way to log onto a Linux box over your network as root? I can
only do that from the console. I've tried over X-Windows, but it says
wrong password. If I could log on as root from another terminal, that
would work, or if I could change things so that someone other than
root could activate ifup and ifdown, that would work.

TIA,
Ed

 
 
 

How do you use ifup and ifdown while not at console?

Post by Me Her » Sun, 31 Dec 1899 09:00:00




Quote:> I have a Linux computer on my network that connects my network to the
> internet. I would like to be able to activate and deactivate the
> connection (by using ifup ppp1 or ifdown ppp1) from another computer on
> my network from which I am logged onto my Linux box through an X-Windows
> session. I keep getting messages that say that users cannot do this. I
> tried changing permissions, but I still cannot do it. Is there any way
> to log onto a Linux box over your network as root? I can only do that
> from the console. I've tried over X-Windows, but it says wrong password.
> If I could log on as root from another terminal, that would work, or if
> I could change things so that someone other than root could activate
> ifup and ifdown, that would work.

> TIA, Ed

This may not be the type of answer you are looking for, but have you
looked into masqdialer, dialcontrol, or DWUN?

They allow remote clients to control your ppp connection.

If you're interested, check DWUN's site which also has links to most of
the other alternate progs. http://dwun.sourceforge.net/

I know masqdialer (which apparently isn't being maintained anymore) can be
setup to use 'ifup(down) ppp0' to control it (it's the default method),
and it has many different clients available for different systems.

HTH...

 
 
 

How do you use ifup and ifdown while not at console?

Post by Leslie Mikese » Sun, 31 Dec 1899 09:00:00




>I have a Linux computer on my network that connects my network to the
>internet. I would like to be able to activate and deactivate the
>connection (by using ifup ppp1 or ifdown ppp1) from another computer
>on my network from which I am logged onto my Linux box through an
>X-Windows session. I keep getting messages that say that users cannot
>do this. I tried changing permissions, but I still cannot do it. Is
>there any way to log onto a Linux box over your network as root? I can
>only do that from the console. I've tried over X-Windows, but it says
>wrong password. If I could log on as root from another terminal, that
>would work, or if I could change things so that someone other than
>root could activate ifup and ifdown, that would work.

After logging in as a normal user you may use the 'su' command
to become root.

  Les Mikesell

 
 
 

How do you use ifup and ifdown while not at console?

Post by Ed Hurs » Sun, 31 Dec 1899 09:00:00



> I have a Linux computer on my network that connects my network to the
> internet. I would like to be able to activate and deactivate the
> connection (by using ifup ppp1 or ifdown ppp1) from another computer
> on my network from which I am logged onto my Linux box through an
> X-Windows session. I keep getting messages that say that users cannot
> do this. I tried changing permissions, but I still cannot do it. Is
> there any way to log onto a Linux box over your network as root? I can
> only do that from the console. I've tried over X-Windows, but it says
> wrong password. If I could log on as root from another terminal, that
> would work, or if I could change things so that someone other than
> root could activate ifup and ifdown, that would work.

> TIA,
> Ed

If you are using a recent distribution, you will have to contend with the
PAM module.  It keeps its own list of permissions for just about anything
like that.  It will take some reading on the documents and some sample
files to decipher how to change permissions.

Ed

 
 
 

How do you use ifup and ifdown while not at console?

Post by Karl-Heinz Herrman » Sun, 31 Dec 1899 09:00:00



> X-Windows session. I keep getting messages that say that users cannot
> do this. I tried changing permissions, but I still cannot do it. Is

let me guess -- ifup and ifdown are shell-scripts.  You can't make the
scripts suid something.

pppd on the other hand must run privileged -- not necessarily root I
think, but needs access to all files in /etc/ppp, chap/pap secrets and
the modem line.

It is possible to setup pppd with a suid bit so it will run with it's
own permissions, then script with only user permissions still can run
it.

For example:
chown root.pppuser /path/to/pppd
chmod 4750 /path/to/pppd

will cause pppd to run with root permissions but will be executable by
all members of the group pppuser. Change to user if you want every
user to do that.

You maybe will have to modify the permissions on some scripts/files in
/etc/ppp to get this running.

To just get root access either do:
su -
rootpasswd

or setup sudo (or su1).

K.-H.

--
-----------------------------------
Karl-Heinz Herrmann

-----------------------------------

 
 
 

How do you use ifup and ifdown while not at console?

Post by wilwa » Sun, 31 Dec 1899 09:00:00





> > I have a Linux computer on my network that connects my network to the
> > internet. I would like to be able to activate and deactivate the
> > connection (by using ifup ppp1 or ifdown ppp1) from another computer on
> > my network from which I am logged onto my Linux box through an X-Windows
> > session. I keep getting messages that say that users cannot do this. I
> > tried changing permissions, but I still cannot do it. Is there any way
> > to log onto a Linux box over your network as root? I can only do that
> > from the console. I've tried over X-Windows, but it says wrong password.
> > If I could log on as root from another terminal, that would work, or if
> > I could change things so that someone other than root could activate
> > ifup and ifdown, that would work.

> > TIA, Ed

> This may not be the type of answer you are looking for, but have you
> looked into masqdialer, dialcontrol, or DWUN?

> They allow remote clients to control your ppp connection.

> If you're interested, check DWUN's site which also has links to most of
> the other alternate progs. http://dwun.sourceforge.net/

> I know masqdialer (which apparently isn't being maintained anymore) can be
> setup to use 'ifup(down) ppp0' to control it (it's the default method),
> and it has many different clients available for different systems.

> HTH...

I recently read this somewhere and it worked for me with RH6.0
Make  a text file,  in it write    /usr/sbin/usernetctl ifcfg-ppp0 up
Save it with a name like isp_up to the desktop and make it ececutible.
Do the same thing for down     /usr/sbin/usernetcfg_ppp0 down.

this puts icons on the desktop and makes them clickable

 
 
 

1. ifup-ppp0 and ifdown ppp0 fron crontab

I have a project I'm working on for a family member: Their Redhat box
has a crontab to dial their ISP at a given time and hangs up a given
time. Should be simple right?
Well my crontab command works to establish the connection but I think
it's failing at taking the connection down  for some reason.
here's the crontab stuff
SHELL=/bin/sh
#
MAILTO=root
##
#run at 8AM
0 8 * * *       /sbin/ifup ppp0
0 12 * * *      /sbin/ifdown ppp0

Like I say "up" is no problem. Down is the question. Here is
/etc/sysconfig/network-scripts/ifcfg-ppp0

DEVICE="ppp0"
ONBOOT=no
USERCTL=yes
MODEMPORT=/dev/ttyS3
LINESPEED=115200
PERSIST=yes <<<< is this keeping the line from going down, or just
keeping it up while it's supposed to be up
DEFABORT=yes
DEBUG=yes
INITSTRING=ATZ
DEFROUTE=yes
HARDFLOWCTL=yes
ESCAPECHARS=no
PPPOPTIONS=

REMIP=
NETMASK=""
IPADDR=
MRU=
MTU=
DISCONNECTTIMEOUT=
RETRYTIMEOUT=5
BOOTPROTO=none
PEERDNS="no"

Does anybody see what is going on? I am a little hamstrung in my
debugging attempts as the box is remote, and there's no one there who
can help me. There aren't any relevant messages in syslog nor and the
mail to root doesn't show anything germane. It just fails to hangup.

Does the "persist" option in /etc/sysconfig/network-scripts/ifcfg-ppp0
cause this?

ALso, in the course of trying to set this up, it seems from the scripts
and observation that if anyone even a user established the
connection--like with the usernet program--the /sbin/ifdown ppp0 command
will fail. Can this be correct? If so isn't there a way around it? I'm
pretty amazed that Redhat or whoever wrote these scripts would design
them in such a way that root or process owned by root would not have the
authority to shut off the network connection at will. Here is what I'm
talking about in ifdown-ppp
[/etc/sysconfig/network-scripts/ifdown-ppp ]

#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin

cd /etc/sysconfig/network-scripts
. network-functions

CONFIG=$1
source_config

file=/var/run/pppwatch-$DEVICE.pid

if [ ! -f $file ]; then
    # ppp isn't running, or we didn't start it  <<<<what is up with
this?
    exit 0
fi
So if user starts ppp0 up root's scheduled job to tear down the
connection will fail?
Please help me figure out how to set this crontab to take precedence
over RH's network scripts. I just want up orderly _on and off_ periods
for the network  and I can't believe it's this difficult.

Thanks for Your Help,
Hazzmat

2. Bad Memory

3. user rights to use ifup, ifdown, ...

4. Scanning & RH6.0 question

5. ifup/ifdown... in BSD?

6. Reading is much more interesting than TV (0018/1708)

7. Debian: doc for /etc/network/interfaces, ifup, ifdown

8. Lilo help(partition entry not found)

9. Help: ifup/ifdown are gone!!

10. ifup/ifdown script oddity

11. ifup & ifdown questions

12. ifup: getting IP info for eth0 failed; unexpected TX-done interrupt

13. Using the mouse port as a kernal console (can it be done)?