PDA

View Full Version : wicd asks for root password



dinosoep
03-10-2011, 12:17 PM
I've been hesitating to ask here or the wicd forums but they appear to be closed to registration :(.
I didn't like nm-applet and for some reason I decided to get rid of it and replace it with wicd.

The problem is that wicd asks for the root password to "get acces to your computer's network card".
After some google searches everyone told me I needed to run the deamon "/etc/init.d/wicd". if it is running wicd will not ask for the root pass.

first I tried to add "/etc/init.d/wicd start" to rc.local. this didn't appear to run and yes I've chmoded 775 to rc.local, I assume this is suposed to make it runnable? so I added "rm -f /home/knoppix/testfile" and after next boot testfile was still there.

then I installed sysv-rc-conf but wicd was already getting started up at boot? after looking with rcconf(another tool) it turned out that knoppix-autoconfigure and another script was never run. So I'm guessing knoppix doesn't really looks at the other /init.d/ scripts and just runs knoppix-autoconfigure.

at last I had a little bit succes with /etc/init.d/knoppix-autoconfigure. I edited it and found some lines that started the default networking deamon. I've replaced it with wicd and sure enough, when I boot and look at "/etc/init.d/wicd status" it says wicd is running.

The problem now is that wicd still asks for a root password but it doesn't mattter what pass I give, it just works.
If i gave a fake pass befor the fix I got a bunch of error messages about the deamon could not be started,... .

I'm using wicd 1.7.0 and knoppix 6.4.4 cd edition.

Forester, from this topic http://www.knoppix.net/forum/threads/29083-Can-we-speed-up-Network-Manager I could see that you have wicd running on a debian system and from here: http://www.knoppix.net/forum/threads/29059-wireless-connects-in-graphical-mode-but-not-in-Adrianne?highlight=wicd I've read you have some notes on a piece of paper about wicd, did I forget a step on that piece of paper?

Forester
03-10-2011, 03:31 PM
Hello dinosoep. I take it that you've got your system working again after the patch problem and this wicd thing isn't actually stopping you doing what you need to do ?

Hmm, Knoppix has it own start up thing as you know and installing stuff like upstart or sysv-rc-conf is very likely to break it.

First thing to check ... is the file /etc/inittab the same as the one on the CD ? This file is not Knoppix specific but its contents are. In particular the line:


si::sysinit:/etc/init.d/knoppix-autoconfig is crucial. The script knoppix-autoconfig is Knoppix specific. What comes after this is not, it is standard SYSV start-up as far as I know. Do an ls -l in any of the directories /etc/rc0.d ... /etc/rcS.d. There directories contain a lot of symbolic links to scripts in /etc/init.d. Look at the README in one of these directories. The script in /etc/init.d do get run when you start up the system but they are run indirectly through these scripts. At least I think so.

When you installed the wicd from the Debian repositories, it should have added new symbolic links in one or more /etc/rc*.d directories and should start automatically. So I don't know what is going on.

I don't know why your changes to rc.local didn't work. I've added ssh and mysql to my services by adding them to:


SERVICES="cups ssh mysql"in rc.local and they start just fine. Altering knoppix-autoconfig should work just fine too. Knoppix does a special here so the cheatcode works. Note there are no symbolic links to /etc/init.d/network-manager.

I don't know why you get asked for a password. In fact, I can't see how you can be asked for a password when you start wicd in the background so I suspect it is obvious to you when it asks you for a password and not obvious to me.

I guess I'll have to install it myself to figure out what you are talking about but that may not be for a day or two.

dinosoep
03-10-2011, 05:01 PM
" I suspect it is obvious to you when it asks you for a password and not obvious to me."
well, wicd assumes the wicd daemon is running. if it's not it starts the daemon but for that it needs root priviliges.
at least thats what they say on the forums.
it is not obvious to me why he asks a pass even if the deamon is running.

and not all patches have been aplied and tested, just squashfs but I"m trying the others too in the near future

Forester
03-10-2011, 05:31 PM
Does wicd ask for the root password in response to something you do or is it spontaneous ?

Do you select menu item or click on a panel icon ?

It it a prompt from the console before the desktop starts or is it a pop-up windows that appears after the desktop first appears ?

dinosoep
03-10-2011, 08:59 PM
spontaneous popup from desktop

dinosoep
03-10-2011, 11:33 PM
Strangest of all is that when I disable wicd applet network gets set up and I can browse the web...
and when I then run wicd-gtk (what the applet also does) I get no root prompt whatsoever

Forester
03-11-2011, 11:45 PM
Hi dinosoep,

I've had a look at the wicd installation I have on Debian and it is fine. I've installed wicd on Knoppix and it too is fine. I don't get asked for a password but I get a notification that a program has been granted permissions without asking for password.

I take back what I said about Knoppix running all the scripts in the directories /etc/rcN.d. There are a lot of services pre-installed that don't get started so ....

There are a few things I'd like you to check. What output does:


ps -ef | fgrep wicdgive (once your wireless network is connected).

What output does:


groupsgive.

Have you set a password for a) knoppix b) root ?

Myself, I've changed my cheat codes to include nonetworkmanager and I've altered /etc/rc.local to:


SERVICES="cups wicd"but I have not (yet) uninstalled the Network Manager itself (it's a KK special so I'm not sure I could reinstall it). This arrangement works fine with LXDE but is, as expected, a bit of a balls up under KDE.

dinosoep
03-12-2011, 02:11 PM
knoppix@Microknoppix:~$ ps -ef | fgrep wicd
knoppix 3197 1 0 13:59 ? 00:00:00 /usr/bin/python -O /usr/share/wicd/gtk/wicd-client.py
root 3285 1 0 13:59 ? 00:00:00 /usr/bin/python -O /usr/share/wicd/daemon/wicd-daemon.py
root 3290 3285 0 13:59 ? 00:00:00 /usr/bin/python -O /usr/share/wicd/daemon/monitor.py
root 3465 1 0 13:59 ? 00:00:00 wpa_supplicant -B -i wlan0 -c /var/lib/wicd/configurations/00259c43f1b8 -D wext
root 3490 1 0 13:59 ? 00:00:00 /sbin/dhclient -v -cf /var/lib/wicd/dhclient.conf wlan0
knoppix 3709 3688 0 14:02 pts/0 00:00:00 fgrep wicd
knoppix@Microknoppix:~$ groups
sudo netdev


I have set a pass on root and knoppix
automatic granting of root acces has been disabled by me (I like it more that way)

But that would actually be the solution to my problem
So I added this to sudoers:


knoppix ALL= NOPASSWD: /usr/sbin/wicd


and for people planning to use wicd, do


sudo leafpad /etc/init.d/knoppix-autoconfig

search for the line


start_net(){
....
}

start_swap(){

and replace it with


start_net(){
addtask "net"; addprogress "Starting network..."
# Remove ifup-statusfile
[ -f /etc/network/run/ifstate ] && rm -f /etc/network/run/ifstate 2>/dev/null
# In theory, we just have to wait for udev to add new network cards,
# and dhclient-daemon will send a broadcast automatically
# dhclient -q -1 -nw >/dev/tty$LOG_CONSOLE 2>&1 &
# /etc/init.d/resolvconf start
# if ! checkbootparam "nodnscache" && [ -x "/etc/init.d/bind9" ]; then
# /etc/init.d/bind9 start
# fi
if ! checkbootparam "nonetworkmanager" && [ -x "/etc/init.d/wicd" ]; then
( /etc/init.d/wicd start & )
else
( ifup -a & )
fi
}

start_swap(){


maybe I should try to make a patch for this?

Forester
03-12-2011, 05:54 PM
I've just watched the the Azuri win. Bravo !

I think devising a patch for knoppix-autoconfig is a very good thing to do.

I see you are fiddling with the sudoers file. Does that make any difference ? I would expect not so I'd be very interested to know if it did.

The processes you show are the same as I have. Three are root processes. These are created by /etc/init.d/wicd, which you start from knoppix-autoconfig. They are thus started in a root context and will not need a password.

The fourth process is a knoppix user process and that would need root privileges to read the wicd configuration files. You get asked for a password 'cos you've told Knoppix to do this. I get a notification 'cos I haven't and I see nothing under Debian. I guess that is because Debian has this root password thingy done differently.


automatic granting of root access has been disabled by meHow do you do that ? I'd like to know.

When you use the great Network Manager is asks you for your password 'cos is has saved your wireless network's key or pass phrase in a 'wallet'. On a (non-Knoppix) machine with several users, each user has their own wallet. With wicd, the wireless network's key or pass phrase is stored in a file only root can read or write but the file is common for all users. So I don't really understand you complaint.

With the great Network Manager, you have to log in before it can read the key or pass phrase so the network connection is made late, which isn't good enough for utu. With wicd, the daemon makes the connection so boot up should be quicker.

You might actually try disable the auto-start of the wicd panel icon and that might remove the password prompt. You can always start the wicd Network Manager from the Main Menu. Oddly enough, its under Internet where you would never expect to find it. :)

dinosoep
03-12-2011, 11:12 PM
yeah, I forget to mention that that little line in the sudoers file removed the sudo pass prompt, exactly the way I want it.

and to disable it edit your sudoers file and comment the line out that goes like this: "knoppix ALL=NOPASSWD :ALL" by placing an # before it

Forester
03-13-2011, 01:48 AM
Umm, I'm really confused now. Would it be too much to ask you you to post your /etc/sudoers file ?

Oh, and how did you disable the automatic granting of root access ?

dinosoep
03-13-2011, 11:10 AM
oops, my bad. I'm terrible at explaining let alone in English.

to disable Auto granting of permissions:


comment the line out that goes like this: "knoppix ALL=NOPASSWD :ALL" by placing an # before it
To disable root prompt for wicd:


knoppix ALL= NOPASSWD: /usr/sbin/wicd
my complete sudoers file right now:


#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset

# Host alias specification

# User alias specification


# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d

#disable wicd root prompt

knoppix ALL= NOPASSWD: /usr/sbin/wicd

Forester
03-13-2011, 03:45 PM
Wow. Now I'm confused. Could you post your /etc/sudoers file for us. ?

I'd also still like to know how you turn off the automatic granting of root access.

dinosoep
03-13-2011, 04:07 PM
Wow. Now I'm confused. Could you post your /etc/sudoers file for us. ?

I'd also still like to know how you turn off the automatic granting of root access.

yes, I can see your pretty confused :p
that code block is my sudoers file, it didn't let me upload the original sudoers file so I pasted the contents.

Forester
03-13-2011, 09:22 PM
:oops: I asked my question a second time because I didn't realise the first question was on page 2 and thought I must have forgotten to ask it in the first place.

I understand now. Knoppix /etc/sudoers comes with the line:


knoppix ALL=NOPASSWD: ALLwhich allows you to sudo anything without a password and the wicd desktop icon thing starts up without asking for a password. Changing this to:


knoppix ALL=PASSWD: ALLis what I thought you must mean when you wrote:


automatic granting of root access has been disabled by meThis means you can still do sudo but you need to enter your password and the wicd desktop icon thing starts up asking for your (i.e. knoppix user not root) password.

Commenting out the line means you can't sudo any commands any more and it does not matter what password you give the wicd desktop icon thing, you can't use it to do anything useful and you may even get a network connection. Hmm. I thought it would fall back to asking for the root password 'cos that was what you said it had done.

So you added an exception to /etc/sudoers allowing wicd to start up properly without a password. Good. Myself I would have done:



knoppix ALL=NOPASSWD: /usr/sbin/wicd
knoppix ALL=PASSWD: ALL
which means sudo wicd without password and sudo everything else with password.

I actually went to the LXDE menu. Desktop Session Settings (I think) and unchecked the option to start the wicd desktop icon thingy. That way I get no icon, so no password prompt, until (if) I start wicd from the LXDE menu. I still get a network connection. I still get a network connection when I boot into console mode with knoppix 2. :)

dinosoep
03-13-2011, 10:24 PM
forester, I think your missing out on the
%sudo ALL=(ALL:ALL) ALL
line.
as knoppix is a member of the sudo group it can still do all commands but you need to enter a password.
so it's essentially the same as
knoppix ALL=PASSWD: ALL
at least it's behaving that way

It could be that I'm making a mistake here because to be honest, I don't understand the sudoers file syntax.

Forester
03-14-2011, 08:25 PM
forester, I think your missing out on the

%sudo ALL=(ALL:ALL) ALLline.


I thought that might come up. My /etc/sudoers contains


# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL
My sudoers is that from Knoppix 6.4.4 MAXI EN edition but the sudo lines are from Debian Lenny. Is yours derived from the 6.4.4 CD or did you carry it forward from 6.4.3 ? It is closer to the lines to be found in Debian Squeeze.

The extra bit in the Debian Squeeze file reads "Note that later entries override this, so you might need to move it further down". So, I revise my last post to:


knoppix ALL=PASSWD: ALL
knoppix ALL=NOPASSWD: /usr/sbin/wicd
My knoppix user is a member of the sudo group, so I too could use the default rule you use. I wonder what we'll find in 6.4.6 when it arrives.