You are not logged in.

#1 2017-07-31 17:15:57

orrin5250
Member
Registered: 2016-10-12
Posts: 39

[SOLVED] Trouble connecting to wifi manually as non-root

I have a fresh Arch install bootable now and I am trying to get wifi connectivity established.  For now I am trying to stick with command line only, manual connection.

As root, this series of commands works:

ip link set wlp3s0f0u2 up
wpa_supplicant -B -i wlp3s0f0u2 -c <(wpa_passphrase "mySSID" "mypassword")
dhcpcd wlp3s0f0u2

I can ping google and git clone from AUR.

However, if I try the same as a non-root user (using sudo) the second command yields:

Successfully initialized wpa_supplicant
Failed to open config file '/dev/fd/63', error: No such file or directory
Failed to read or parse configuration '/dev/fd/63'.

And the 3rd command tries but hangs at 'waiting for carrier'

I am not sure where to go from here.  Not for lack of trying but I poked in so many directions it is probably not helpful to list them.

Any ideas?

Also, I actually have a lot of confusion about network configuration and have multiple basic questions.  Is it acceptable to list them here or is that too much for one post? (Yes I studied the wiki and googled.)

Last edited by orrin5250 (2017-07-31 23:57:50)

Offline

#2 2017-07-31 17:44:39

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Trouble connecting to wifi manually as non-root

orrin5250 wrote:

However, if I try the same as a non-root user (using sudo) the second command yields:

Successfully initialized wpa_supplicant
Failed to open config file '/dev/fd/63', error: No such file or directory
Failed to read or parse configuration '/dev/fd/63'.

Create a configuration file instead (by piping redirecting the `wpa_passphrase` output) and call that with -c

Or use

sudo wifi-menu

Kill wpa_supplicant & dhcpcd before running that though.

EDIT:

have multiple basic questions.  Is it acceptable to list them here

Not really — one query, one thread is the general rule.

Last edited by Head_on_a_Stick (2017-07-31 17:46:51)


Jin, Jîyan, Azadî

Offline

#3 2017-07-31 20:59:53

orrin5250
Member
Registered: 2016-10-12
Posts: 39

Re: [SOLVED] Trouble connecting to wifi manually as non-root

I first did:

killall dhcpcd
killall wpa_supplicant

Tried the wifi-menu dialog. At the end it said "connection failed".  Then prompted to save profile which I did.

I looked in some /etc folders.

/etc/wpa_supplicant is empty.
But a new file has popped up in /etc/netctl (same name as the profile I saved above + timestamp matches too).

Contents as follows:

Interface=wlp3s0f0u2
Connection=wireless
Security=wpa
ESSID=mySSID
IP=dhcp
Key=*******

I didn't think I had tried using netctl at any point but maybe I am mistaken.

Offline

#4 2017-07-31 21:08:04

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Trouble connecting to wifi manually as non-root

orrin5250 wrote:

At the end it said "connection failed"

I'm pretty sure that it "said" more than that...

https://bbs.archlinux.org/viewtopic.php?id=57855

Why not post the `journalctl` output requested by the error message?

That would save us all some time, I think.

I didn't think I had tried using netctl at any point but maybe I am mistaken.

Oh good, let's investigate:

systemctl list-unit-files --state=enabled

FWIW, `wifi-menu` should work from a fresh boot provided no other networking .services are enabled.


Jin, Jîyan, Azadî

Offline

#5 2017-07-31 23:56:51

orrin5250
Member
Registered: 2016-10-12
Posts: 39

Re: [SOLVED] Trouble connecting to wifi manually as non-root

Sorry about being less than thorough with the information provided...I probably should have given a fresh look tomorrow.

Regardless, I was concerned that there was a tangled web to be unwound from all that I had tried previously.

I went ahead and did a fresh install of Arch.

Your recommendation to create a configuration file for wpa_supplicant was successful.

Of note, in having another look at the wpa_supplicant page on the wiki, I found this:

Note: Because of the process substitution, you cannot run this command with sudo - you will need a root shell. Just pre-pending sudo will lead to the following error:

Successfully initialized wpa_supplicant
Failed to open config file '/dev/fd/63', error: No such file or directory
Failed to read or parse configuration '/dev/fd/63'

So I guess that implies no manual connection for non-root?

Like I said, probably should have slept on it.

Also, I did initially try wifi-menu again.  It connected and again created the same config file in /etc/netctl. 
I am not sure how that relates to using wpa_supplicant.  No wpa_supplicant config file was generated, but as I said creating it manually worked.  Thanks.

Last edited by orrin5250 (2017-07-31 23:59:11)

Offline

#6 2017-08-02 06:34:25

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Trouble connecting to wifi manually as non-root

orrin5250 wrote:

So I guess that implies no manual connection for non-root?

Your problem was that the shell redirection could not work if preceded by a command issued with "higher" privileges.

"/dev/fd/63" is the name given to the open file created by the `wpa_passphrase` output, this cannot be added to the `wpa_supplicant` command unless it is also run as root:

sudo bash -c 'wpa_supplicant -B -i wlp3s0f0u2 -c <(wpa_passphrase "mySSID" "mypassword")'

Incidentally, your (initial) problem with `wifi-menu` was because I forgot to tell you to set the interface down before trying it:

# ip l set wlp2s0f0u2 down
# wifi-menu

The cause would have been clearly printed in the journal and the solution is clearly printed in the ArchWiki.


Jin, Jîyan, Azadî

Offline

#7 2017-08-02 10:06:05

orrin5250
Member
Registered: 2016-10-12
Posts: 39

Re: [SOLVED] Trouble connecting to wifi manually as non-root

@Head_on_a_Stick -- the further explanation is much appreciated.

Offline

Board footer

Powered by FluxBB