Schnell
Posts: 19
Joined: Sat Jun 21, 2014 4:02 am

Cannot access wpa_supplicant.conf, Permission Denied

Sat Jun 21, 2014 4:18 am

Hello,

I am on a conquest to fix my Wifi issues in both Pi Music Box as well as Raspbian. My issue lies in the fact that the file wpa_supplicant can never be accessed as it always says Permission denied or that I don't have the required permissions. I have come to the conclusion that the reason Raspbian could not access the file to edit it to add my wifi access point in it, is because the file is locked to god-knows-what. So right now I'm trying to access the file by simply typing in "/etc/wpa_supplicant/wpa_supplicant.conf". Permission denied. If I use the cat command before that then I can view it. However editing the file is not going to happen. I've also tried accessing the file while in Ubuntu on a different computer to no avail.
Also, I am new to using Raspberry Pi, so if it is an extremely easy fix that I just looked over, please excuse my ignorance. If any more info is required feel free to ask and I will provide.

Thank you,
Schnell

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5000
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Cannot access wpa_supplicant.conf, Permission Denied

Sat Jun 21, 2014 8:12 am

Schnell wrote:Hello,
I am on a conquest to fix my Wifi issues in both Pi Music Box as well as Raspbian. My issue lies in the fact that the file wpa_supplicant can never be accessed as it always says Permission denied or that I don't have the required permissions. I have come to the conclusion that the reason Raspbian could not access the file to edit it to add my wifi access point in it, is because the file is locked to god-knows-what. So right now I'm trying to access the file by simply typing in "/etc/wpa_supplicant/wpa_supplicant.conf". Permission denied. If I use the cat command before that then I can view it. However editing the file is not going to happen. I've also tried accessing the file while in Ubuntu on a different computer to no avail.
Also, I am new to using Raspberry Pi, so if it is an extremely easy fix that I just looked over, please excuse my ignorance. If any more info is required feel free to ask and I will provide.
Thank you,
Schnell
How did you try to edit the file (on the Pi)?
Did you prefix the (editing) command with sudo? (Eg. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf )
(For most files in /etc/.... you need "root" access - depending upon how the SDHC card is mounted, Ubuntu would probably require such too)
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Schnell
Posts: 19
Joined: Sat Jun 21, 2014 4:02 am

Re: Cannot access wpa_supplicant.conf, Permission Denied

Sat Jun 21, 2014 8:25 pm

At first I tried simply typing in /etc/wpa_supplicant/wpa_supplicant.conf. Which didn't work due to permission denied. Then after you said to use Su, I typed in su /etc/wpa_supplicant/wpa_supplicant.conf which just led to the console printing "No passwd enry for user '/etc/wpa_supplicant/wpa_supplicant.conf'.(Using Sudo just leads to it printing command not found after) Also I installed vi earlier and that allowed me to edit the /etc/wpa_supplicant/wpa_supplicant.conf file perfectly fine.
I am using Pi Music Box. But this also happened with Raspbian where when I was in the Gui the Wifigo or whatever it is couldn't set up the wpa_supplicant file or couldn't load it.

User avatar
toad
Posts: 11
Joined: Thu Jun 19, 2014 1:27 am
Location: Canada now

Re: Cannot access wpa_supplicant.conf, Permission Denied

Sat Jun 21, 2014 9:48 pm

You must enter it as "sudo" - all lower case. "Sudo" with capital "S" doesn't exist. Case sensitive.

You also need to edit the file. Not just type it in. I just started with Raspberry Pi yesterday evening. And had to edit my wpa_supplicant.conf too. What I did is: opened a terminal window and then typed

Code: Select all

$ sudo leafpad
. the "$" is the prompt, don't type it. "leafpad" is the editor I found within Rasbian, the operating system. There are other editors, but this works. Then you have to open the file by getting to /etc/wpa_supplicant/ and then editting wpa_supplicant.conf and then save it. I had to restart the rPi to make it work.

Don't worry, you will get going pretty soon.
strive be kind

RASPmke
Posts: 8
Joined: Sun Jun 15, 2014 12:32 pm
Location: Japan

Re: Cannot access wpa_supplicant.conf, Permission Denied

Sun Jun 22, 2014 2:42 am

Don't take it personal, please.

You seem to be a Linux beginner (using Sudo instead of sudo), so I recommend to look for a basic introduction to Linux and study it in addition to only "training by doing" (which can be dangerous from time to time).

You could f.e. start with the free ubuntu manual, found here
https://ubuntu-manual.org/
as both Raspbian and Ubuntu are based on Debian, they resemble a lot.

Enjoy.

Schnell
Posts: 19
Joined: Sat Jun 21, 2014 4:02 am

Re: Cannot access wpa_supplicant.conf, Permission Denied

Mon Jun 23, 2014 6:00 pm

No worry guys, I didn't take it personal at all ^_^

Yeah I just typed it wrong in the forum post, I've been using it right in the command line. One thing I'm curious about though is that even when logged in as root, I could access the wpa_supplicant when typing in /etc/wpa_supplicant/wpa_supplicant.conf. As it would say permission denied. Using vi would allow me to edit it, which I did and now all is well, but just typing it in would result in permission denied. I assume that is just because I didn't specify and editing program.
Oh and another thing, when I was using Raspbian before and would try to use the Wifi program, it would say that it couldn't access the wpa_supplicant.

Thanks again for your help.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Cannot access wpa_supplicant.conf, Permission Denied

Mon Jun 23, 2014 7:21 pm

Schnell wrote:No worry guys, I didn't take it personal at all ^_^

Yeah I just typed it wrong in the forum post, I've been using it right in the command line. One thing I'm curious about though is that even when logged in as root, I could access the wpa_supplicant when typing in /etc/wpa_supplicant/wpa_supplicant.conf. As it would say permission denied.
It would do as you are trying to execute /etc/wpa_supplicant/wpa_supplicant.conf, and it isn't executable:

Code: Select all

root@raspberrypi:~# ls -l /etc/wpa_supplicant/wpa_supplicant.conf
-rw------- 1 root root 72 Jan  7 21:31 /etc/wpa_supplicant/wpa_supplicant.conf
root@raspberrypi:~# /etc/wpa_supplicant/wpa_supplicant.conf
-su: /etc/wpa_supplicant/wpa_supplicant.conf: Permission denied
Even if you did make it executable, it still doesn't do much:

Code: Select all

root@raspberrypi:~# chmod +x /etc/wpa_supplicant/wpa_supplicant.conf
root@raspberrypi:~# ls -l /etc/wpa_supplicant/wpa_supplicant.conf
-rwx--x--x 1 root root 72 Jan  7 21:31 /etc/wpa_supplicant/wpa_supplicant.conf
root@raspberrypi:~# /etc/wpa_supplicant/wpa_supplicant.conf
But mine doesn't have much in it:

Code: Select all

root@raspberrypi:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
Normally .conf (configuration) files are read by other programs and aren't directly run.

Return to “Troubleshooting”