On Thu, Feb 04, 1999 at 08:12:27AM +0300, Maxim Tchervinsky wrote:
> Hello Damon,
>
> My personal impression it is because of pppd. I was able to launch pppd as a
> particular user in RH5.0, but after RH5.1 installation with pppd 2.3.3 this
> stopped work. Sticky bit does not help, and according to man only root has
> full control over pppd, while particular users have only limited capabilities.
>
> I would appreciate if anybody will suggest how to change this behavior. So far
> I enter root password every time I start connection (fortunately, it is same
> as my password :)
The following is not good advice on a shared system with untrusted
users. For an individual workstation or small group server, with
every user trusted, some, myself included, use something like this.
Indention indicates quoting, below. Delete indents if you use
quoted stuff from this post.
In /etc/passwd:
host::0:0:root:/etc/ppp:/etc/ppp/scripts/host
And in /etc/ppp/scripts, a script called "host":
#!/bin/sh
#
# Script to initiate a ppp connection using pppd-2.3.5
setup_connection() {
#/sbin/insmod ppp_deflate
/usr/sbin/pppd call host
}
setup_connection &
#tail -f /var/log/messages
Uncomment the "insmod" if you aren't autoloading modules
and want deflate compression. Substitute the other kind
of compression if you like. "host" is a name for the host
you are trying to connect with. Several such setups can
live happily side-by-side, under different host names.
Uncomment the "tail -f" to debug; substitute wherever your
debug info comes out for "/var/log/messages".
Then to fire up ppp, you just
su host
Or as in my case, make that the command to execute from
a KDE icon. By using ip-up and ip-down scripts that look
something like:
#!/bin/sh
[ -f /etc/ppp/up/$6 ] && exec /etc/ppp/up/$6
#!/bin/sh
[ -f /etc/ppp/down/$6 ] && exec /etc/ppp/down/$6
You can have host-specific actions ($6 expands to "host" in my
example). For example, my /etc/ppp/up/host reads:
#!/bin/sh
cp /etc/ppp/resolv/host /etc/resolv.conf
[ -f /etc/ppp/sound/up ] && cat /etc/ppp/sound/up >/dev/audio
which points name service to host "host" and emits a "boing"
sound to tell me the connection is going.
To take down the connection, a similar scheme may be used.
In /etc/passwd:
ppp-off::0:0:root:/etc/ppp:/etc/ppp/ppp-off
and /etc/ppp/ppp-off says merely:
#!/bin/sh
killall pppd
It may be reached with
su ppp-off
or in my case, by clicking on the "off" icon.
--
Dan Wilder <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [EMAIL PROTECTED]