Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Several questions -- various topics
Date: Mon, 20 Nov 2006 20:11:11
Message-Id: 200611201950.15927.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] Several questions -- various topics by Michael Crute
1 On Monday 20 November 2006 13:59, Michael Crute wrote:
2 > On 11/20/06, Timothy A. Holmes <tholmes@×××××××××.net> wrote:
3 > > I have tried a sudo command for a switch on the modubar
4 > > and it seemed to fight back, but its possible that I didn't get
5 > > it set up right. Any suggestions or pointers would be very helpful.
6
7 As far as I know there are 3, maybe 4 ways of running a script as root:
8
9 a)You launch a terminal as a plain user and then su to root; which
10 unfortunately requires you to enter a password.
11
12 The menu entry could be something like:
13 ===================================================
14 [exec] (eth0 up) {xterm -e su -c '/etc/init.d/net.eth0 start'}
15 </usr/kde/3.5/share/icons/hicolor/32x32/apps/knetattach.png>
16 ===================================================
17
18 This will launch an xterm which will ask you for a password (root) before you
19 can login and execute the init.d script.
20
21 b)You have already defined the command in sudo in which case you can run it
22 directly as a plain user.
23
24 The menu entry could look like this:
25 ===================================================
26 [exec] (eth0 down) {xterm -e sudo /etc/init.d/net.eth0 stop}
27 ===================================================
28
29 The sudoers entry to allow the particular init.d script to run looks like so:
30 ===================================================
31 # Host alias specification
32 Host_Alias BOX1 = lappy
33 # User alias specification
34 User_Alias ME = michael
35
36 # Shutting down the Internet
37 ME BOX1 = NOPASSWD: /etc/init.d/net.eth0 stop
38 ===================================================
39
40 c)You set the root password to remain in memory for a set period of time
41 after you enter it once, so that you do not have to enter it *every* time you
42 su to root. I can't remember where you set this . . . probably because I
43 have never used it (for security purposes). Someone else please fill in
44 this?
45
46 d)You can set the executable script as suid. Then it will run with the
47 owners permissions (root) as opposed to the person who's running it (plain
48 user)
49
50 > > I am looking for recommendations on a multi network chat client. I
51 > > have been using gaim for quite some time, however, there are some
52 > > problems in the latest version, and it does not seem that they will be
53 > > resolved for quite some time. I have looked at kopete, but its irc
54 > > support is very lacking, especially compared to kvirc which I love. I
55 > > am interested in hearing what other options might be out there.
56
57 ksirc? Not as nice as kvirc, but probably lighter on resources. There's also
58 terminal based clients (but haven't used any).
59 --
60 Regards,
61 Mick

Replies

Subject Author
Re: [gentoo-user] Several questions -- various topics Mrugesh Karnik <mrugeshkarnik@×××××.com>