Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_supplicant -- how to use as 'user' not 'root' [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Mon Dec 05, 2011 5:40 pm    Post subject: wpa_supplicant -- how to use as 'user' not 'root' [SOLVED] Reply with quote

I'm using wpa_supplicant, but would like to scan and connect using the nice wpa_gui

...I must have missed a step in setup, but not sure what...

right now, wpa_supplicant opens at startup, but does not connect to anything...so I must first open a terminal shell, log in as root and type 'iwlist scan'

instead of these steps, I'd like to just click on 'scan' and select the wireless network to connect and click 'connect'

...is this possible?

Quote:
papapenguin ~ # rc-update show
acpid | battery boot default
alsasound | boot
bootmisc | boot
consolefont | boot
consolekit | battery default
cupsd | default
dbus | battery default
devfs | sysinit
device-mapper | boot
dmesg | sysinit
fsck | boot
hostname | boot
hwclock | boot
keymaps | boot
killprocs | shutdown
local | battery default nonetwork
localmount | boot
lvm | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.lo | boot
net.wlan0 | battery default
netmount | battery default
ntp-client | default
ntpd | default
procfs | boot
root | boot
savecache | shutdown
staticroute | boot
swap | boot
sysctl | boot
syslog-ng | battery default
termencoding | boot
udev | sysinit
udev-postmount | default
urandom | boot
xdm | battery default
papapenguin ~ #

Quote:
papapenguin ~ # cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
papapenguin ~ #

_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------


Last edited by papapenguin on Wed Dec 14, 2011 5:12 am; edited 1 time in total
Back to top
View user's profile Send private message
cach0rr0
Moderator
Moderator


Joined: 13 Nov 2008
Posts: 4121
Location: Houston, Republic of Texas

PostPosted: Mon Dec 05, 2011 6:00 pm    Post subject: Re: wpa_supplicant -- how to use as 'user' instead of 'root' Reply with quote

papapenguin wrote:

instead of these steps, I'd like to just click on 'scan' and select the wireless network to connect and click 'connect'


not sure I'm following exactly; you basically want a UI that'll let you do this? have you checked out wicd or wpa_gui ?

normally to allow a non-root user to be able to interact *directly* with wpa_supplicant, you have something like this in wpa_supplicant.conf

Code:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel


but that's more for CLI access. If you want a UI so that things are point and click, my personal preference is wicd (built with USE="gtk"), but wpa_gui works as well. With wicd at least, no setup of /etc/conf.d/net is required, no setup of wpa_supplicant.conf required. Just start the daemon at 'default' runlevel, launch wicd-gtk whenever you feel like it (in some DE's you can set its tray icon to appear automatically), point, click,connect.

I'll re-read your post and see if I've missed something just in case, but yeah...part of it implies "how to set up wpa_supplicant", part of it is "I would like a UI"
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
chtof
n00b
n00b


Joined: 29 Aug 2003
Posts: 61
Location: France

PostPosted: Mon Dec 05, 2011 6:06 pm    Post subject: Reply with quote

It runs properly for me, maybe because I have "ctrl_interface_group=wheel" in /etc/wpa_supplicant/wpa_supplicant.conf and my user belongs to this group ( /etc/group : wheel:x:10:root,username.

And also, according http://en.gentoo-wiki.com/wiki/Wireless/Configuration :
Quote:
To use wpa_gui, the gui supplied by wpa_supplicant, you need:
File: /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
# Here group is an entry of /etc/group
ctrl_interface_group=users
update_config=1
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Mon Dec 05, 2011 6:36 pm    Post subject: Reply with quote

thanks cach0rr0, I do use wpa_gui, I'm just trying to use it as a user, instead of root, I'd just like to click 'scan' and connect to a wifi signal...

also thanks chtof, here is my wpa_supplicant.conf, in which, I am in the 'wheel' group, which is also why I'm asking the question...why can I not access this without root privileges?
Quote:
papapenguin ~ # cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=0
update_config=1

network={
key_mgmt=NONE
priority=-9999999
disabled=1
}

network={
ssid="KirkWiFi"
key_mgmt=NONE
disabled=1
}

network={
ssid="GENTOO"
key_mgmt=NONE
disabled=1
}

network={
ssid="kitanda"
key_mgmt=NONE
auth_alg=OPEN
wep_key0=caffe12345
disabled=1
}

network={
ssid="Concert"
psk="ZXCVbnm!"
proto=RSN
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP WEP104 WEP40
auth_alg=OPEN
disabled=1
}

network={
ssid="kcls.org Wireless"
key_mgmt=NONE
auth_alg=OPEN
disabled=1
}

network={
ssid="Blackfoot_000865"
psk="F45FF7045F54"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP WEP104 WEP40
auth_alg=OPEN
disabled=1
}

network={
ssid="linksys"
key_mgmt=NONE
auth_alg=OPEN
disabled=1
}

network={
ssid="@HomeBD8D"
key_mgmt=NONE
auth_alg=OPEN
}

network={
ssid="kuntzhome"
psk="akaclear"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP WEP104 WEP40
auth_alg=OPEN
disabled=1
}

network={
ssid="HomeNetCW"
psk="19191919191919191919191919"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP WEP104 WEP40
auth_alg=OPEN
disabled=1
}

network={
ssid="NETGEAR"
key_mgmt=NONE
auth_alg=OPEN
disabled=1
}

network={
ssid="cafe cesura"
psk="10151015"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
papapenguin ~ #

_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
cach0rr0
Moderator
Moderator


Joined: 13 Nov 2008
Posts: 4121
Location: Houston, Republic of Texas

PostPosted: Mon Dec 05, 2011 6:53 pm    Post subject: Reply with quote

papapenguin wrote:
thanks cach0rr0, I do use wpa_gui,


whoops, yeah I re-read your post. Sorry about that, too early, eyes not working all that well at the time!

unless the control group is getting ignored i dont know why it would require root; no great ideas there unfortunately
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Mon Dec 05, 2011 7:18 pm    Post subject: Reply with quote

ok, so how would I know if the control group is getting ignored? and then, how would I fix that?
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Mon Dec 05, 2011 7:39 pm    Post subject: Reply with quote

so this is what happens, as well as I can remember it...

upon startup, wpa_supplicant and the wpa_gui start up,

but on startup, the wpa_gui shows a network (most likely the last network that was connected), but shows status as 'disconnected'

to connect, I must open a terminal, log in as root and type 'iwlist scan'

I cannot just click 'connect' nor can I change anything in the wpa_gui

any ideas?
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
derk
Apprentice
Apprentice


Joined: 10 Mar 2003
Posts: 277
Location: St Thomas Ontario

PostPosted: Mon Dec 05, 2011 9:59 pm    Post subject: Reply with quote

maybe set ap_scan=1 or comment it out .. my working configuration does not have that line
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Dec 05, 2011 10:51 pm    Post subject: Reply with quote

Since you're not using /etc/conf.d/net (it's blank), maybe try removing net.* scripts from the default runlevel, and add dhcpcd and wpa_supplicant instead?
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
papapenguin
l33t
l33t


Joined: 20 Sep 2005
Posts: 694
Location: Bellevue

PostPosted: Wed Dec 14, 2011 5:11 am    Post subject: Reply with quote

thanks all, what solved it was actually setting
Quote:
ap_scan=1

not sure why it is automatically set to 0...

thanks derk...

now my wpa_supplicant and wpa_gui automatically connect to my network, I haven't tried it on a public wireless network, yet...
_________________
--------------
Compaq Presario V6120US
AMD Turion 64X2
------------------------
Back to top
View user's profile Send private message
frank56
Tux's lil' helper
Tux's lil' helper


Joined: 02 Nov 2009
Posts: 98

PostPosted: Tue Jan 03, 2012 11:52 pm    Post subject: This solved it for me Reply with quote

Etal wrote:
Since you're not using /etc/conf.d/net (it's blank), maybe try removing net.* scripts from the default runlevel, and add dhcpcd and wpa_supplicant instead?


I had tried, it seems everything, but doing just what Etal suggested here to care of it. I have some entries, in /etc/conf.d/net but these steps alone solved my problem. Which was I could start wpa_gui from root console, but not from desktop application, or from regular user console Thanks Etal and others contributing to this thread.
_________________
Dell GX 270 Desktop, ATA 20gb HD,Pata host controller and uname -a = Linux frank 3.0.6 2011 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz GenuineIntel GNU/Linux Netgear router Broadcom NIC
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum