Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Serial modem and permissions problem.
Date: Mon, 05 Mar 2007 04:04:10
Message-Id: 20070305035733.GA6767@waltdnes.org
In Reply to: Re: [gentoo-user] Serial modem and permissions problem. by Dan Farrell
1 On Sun, Mar 04, 2007 at 02:18:41PM -0600, Dan Farrell wrote
2
3 > FWIW, it was kind of a PITA to set up dialup in a secure way for
4 > multiple users to use with traditional UNIX permissioning.
5
6 I'm the only person on my machine, but things get complicated because
7 the dialup is emergency backup for my ADSL connection. I can't get the
8 two connections to co-exist peacefully. Furthermore, I use different
9 ISPs for broadband and dialup, because problems at an ISP might take
10 down both broadband and dialup access. That means that I have to copy
11 over a different /etc/ssmtp/ssmtp.conf. So my ~/bin/dialup script is...
12
13 #!/bin/bash
14 /usr/bin/sudo /sbin/ifconfig eth0 down
15 /usr/bin/sudo /usr/bin/cp -f /etc/ssmtp/295.ssmtp.conf /etc/ssmtp/ssmtp.conf
16 /usr/bin/sudo /usr/sbin/pon 295caext
17
18 The 3 commands...
19 1) tear down eth0
20 2) copy in the appropriate ssmtp.conf for my dialup ISP
21 3) run pon to actually dialup
22
23 My ~/bin/dialdown (hang up dialup, and restore ADSL) script is
24
25 #!/bin/bash
26 /usr/bin/sudo /usr/sbin/poff
27 /usr/bin/sudo /usr/bin/cp -f /etc/ssmtp/istop.ssmtp.conf /etc/ssmtp/ssmtp.conf
28 /usr/bin/sudo /etc/init.d/net.eth0 restart
29
30 1) hang up the dialup connection
31 2) copy in the appropriate ssmtp.conf for my ADSL ISP
32 3) bring up eth0
33
34 To enable doing this without passwords, my /etc/sudoers contains...
35
36 waltdnes m3000 = (root) NOPASSWD: /sbin/ifconfig eth0 down
37 waltdnes m3000 = (root) NOPASSWD: /usr/bin/cp -f /etc/ssmtp/295.ssmtp.conf /etc/ssmtp/ssmtp.conf
38 waltdnes m3000 = (root) NOPASSWD: /usr/sbin/pon 295caext
39 waltdnes m3000 = (root) NOPASSWD: /usr/sbin/poff
40 waltdnes m3000 = (root) NOPASSWD: /usr/bin/cp -f /etc/ssmtp/istop.ssmtp.conf /etc/ssmtp/ssmtp.conf
41 waltdnes m3000 = (root) NOPASSWD: /etc/init.d/net.eth0 restart
42
43 --
44 Walter Dnes <waltdnes@××××××××.org> In linux /sbin/init is Job #1
45 --
46 gentoo-user@g.o mailing list