WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bootlocal.sh permission denied  (Read 21896 times)

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
bootlocal.sh permission denied
« on: August 19, 2019, 09:49:22 PM »
I want to add to bootlocal.sh but when I open in editor and try to save, I get permission denied.

I know NOTHING about linux or tiny core or micro-core.  An employee installed micro-core on a bunch of ancient laptops for me because I didn't want to just chuck 'em.  You know?  But he's no longer with us.

So now, where I work, has a hidden wifi ssid, so I googled and found a bootlocal.sh code ... but I'm not sure if "editor" is even what to use.

I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.

I googled and found some codes that were supposed to be for permissions:
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chown 775 /opt/bootlocal.sh

but was not sure where or how to use them.  I tried the terminal, but to no effect.

Now, I'm not 100% useless.  I've been using computer for over 35 years, since before windows.  I mean, I had a sinclair computer that I played with as a kid ... so I remember old dos commands, etc.

But still, I'm out of my element here.  Can anybody give a clueless newb some advice?
Thanks!

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #1 on: August 19, 2019, 10:03:11 PM »
Hi kirin-rex
Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Editor is what I use when editing files.

Quote
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to  SystemTools->ControlPanel.  Click the  Backup/Restore  button. The  Backup Maintenance  app will open.

    [EDIT]: Crossed out the incorrect answer I gave.  Rich
« Last Edit: August 21, 2019, 09:51:04 AM by Rich »

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #2 on: August 19, 2019, 10:55:11 PM »
Hi kirin-rex
Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Editor is what I use when editing files.

Quote
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to  SystemTools->ControlPanel.  Click the  Backup/Restore  button. The  Backup Maintenance  app will open.

Thank you for your answer!

For these codes, how do I use them?  Do I add them to bootlocal.sh with editor?  Do I use terminal?  I tried terminal, but it didn't fix the permissions on bootlocal as far as I can tell.

I also looked at backup/restore, and opened the backup maintenance tool, but didn't see options to add something to bootlocal, but am not terribly worried since you mentioned that editor can make those changes.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #3 on: August 19, 2019, 11:05:09 PM »
Hi kirin-rex
You enter these commands from a terminal:
Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh

You can check it's correct with the  ls  command:
Code: [Select]
tc@box:~$ ls -l /opt/bootlocal.sh
-rwxrwxr-x 1 root staff 132 Feb 28  2012 /opt/bootlocal.sh
tc@box:~$
« Last Edit: August 20, 2019, 10:41:37 AM by Rich »

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #4 on: August 20, 2019, 01:39:44 AM »
Thank you very much.  I was able to successfully edit the bootlocal.sh.

However, I'm still having trouble connecting to a hidden wifi.  When I click the wifi icon, of course my workplace wifi doesn't show up.

I looked at this thread:
http://forum.tinycorelinux.net/index.php?topic=19453.0

Thank's nitram.
 Your solution may work, but I was not able to open the SSID for evaluation. But finally I've found this solution.
The way is to use the manual config, wifi.sh can't be used at all. The issue was that wpa need to scan ssid's and test them.
I'm using the channel 11 and it takes roughly 12 seconds.
This is my tutorial:

First need to be created the config file, for example /tmp/wifi.cfg.

Code: (bash) [Select]
network={
scan_ssid=1
ssid="yourwifiname"
psk="yourwifipassword"
}

The most important is the scan_ssid=1 parameter which executes the network scan and enables the connection to the hidden networks. This function is not supported by wifi.sh script. The psk may be used in encrypted format generated via wpa_passphrase.

Than need to be created some script for wpa execution and ip querry. This script may be added to bootlocal.sh for automated execution at boot.

Code: (bash) [Select]
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c/tmp/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10

The first line may not be necessary at all cases, but some my dongles need it.
The -t 10 parameter is important to safely obtain the ip, because the wpa need pretty long time to scan all the channels as mentioned above. This gives 10 queries with 3 seconds delay, totally 30 second.

This works well and i'ts simple.
I found though that putting the newly created wifi.cfg in /tmp/ was a bad idea since that gets cleaned out on reboot, so I put it in /home/.

However, I still don't have it working.  However, I really don't know what I'm doing.  I'm just not knowledgeable enough to know if this is the right thing to do.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #5 on: August 21, 2019, 01:38:18 AM »
Hi kirin-rex
The first question is did you install  wpa_supplicant.tcz ?

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #6 on: August 21, 2019, 09:20:24 AM »
No, I haven't, but I know I saw a reference to that recently, but unfortunately, today I was working on deadlines and didn't have time to research it, but the little bit I read indicated I have a lot more research to do.

1.  May I assume this is something I need to download?  If so, I'm pretty sure I know how to do that.


Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #7 on: August 21, 2019, 09:45:34 AM »
Hi kirin-rex
... 1.  May I assume this is something I need to download?  If so, I'm pretty sure I know how to do that. ...
Yes. Without that extension (and its dependencies) none of that will work. If you have a wired network connection available for
that machine, you can click on the  Apps  icon to install it.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #8 on: August 21, 2019, 10:00:05 AM »
Hi kirin-rex

 ----~ SNIP ~----

Quote
I've seen screenshots where apparently you can right-click desktop, go to "TOOLS" and select "ADD to BOOTLOCAL" but I don't get that with these laptops.
Right-click desktop, go to  SystemTools->ControlPanel.  Click the  Backup/Restore  button. The  Backup Maintenance  app will open.

 ----~ SNIP ~----

I also looked at backup/restore, and opened the backup maintenance tool, but didn't see options to add something to bootlocal, but am not terribly worried since you mentioned that editor can make those changes.

That's because that answer was just plain wrong and the clown that gave it should have his keyboard taken away. ;D

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #9 on: August 22, 2019, 09:29:47 PM »
Thank you for taking time to help me learn this.  I really appreciate it.

I used a wired connection to install wpa_supplicant.tcz ... and in case you're wondering why I don't use a wired connection all the time, it's because I'm going to be running multiple computers and wifi is easier than wiring them all.

Unfortunately, after rebooting, I still don't have wifi.  As a side note:  before my workplace installed our new lan system, with new ssid and password and hidden ssid, I could connect the wifi from the same pc using the wifi icon, and the wifi.db had the information saved.

So here's what I've got so far:
1.  Installed wpa=supplicant.tcz

2.  added the following code to bootlocal.sh and saved
Code: [Select]
if config wlan0 up
wpa_supplicant -iwlan0 -c/home/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
I'm wondering if wlan0 (zero) is correct ... I have only whatever wifi capabilities came with the laptop.  It's not a wifi chip.  Would that be zero, then?

3.  created a document in editor called wifi.cfg and saved it in the /home/ folder, and later to /home/tc/ as well.  In it is the following script
Code: [Select]
network={
scan_ssid=1
ssid="wifiname"
psk="password"
}
and substituted my actual wifiname and password.  I put the wifiname and password in quotations.  Is that what I'm supposed to do, or do I leave them quotation marks off?  I've tried both ways, and neither worked so far.

4.  I used the code you game me earlier
Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh
Which allowed me to finally save the changes to bootlocal.sh

5.  I tried manually modifying wifi.db with the new name and pw.  I'm wondering now if I should delete wifi.db.  Could it be conflicting somewhere?

Because rebooting and trying to run firefox still didn't get me connected ...
6.  I tried running the code I posted earlier:
Code: [Select]
wpa_supplicant iwlan0 -c/home/wifi.cfg -Dwext -Bdirectly into terminal.

This gave me the following message:
Quote
successfully initialized wpa=supplicant
ioct1[SIOCSIWPMKSA] Operation Not Permitted
ioct1[WIOCSIWMODE] Operation not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
12=packet=init: socket(PF=PACKET) Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
could not set interface wlan0 flags (DOWN): Operation Not Permitted

Seems I have a general problem with permissions ...
« Last Edit: August 22, 2019, 09:33:46 PM by kirin-rex »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #10 on: August 22, 2019, 09:50:34 PM »
Hi kirin-rex
... 2.  added the following code to bootlocal.sh and saved
Code: [Select]
if config wlan0 up
wpa_supplicant -iwlan0 -c/home/wifi.cfg -Dwext -B
udhcpc -i wlan0 -t 10
Shouldn't that be:
Code: [Select]
wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
... 6.  I tried running the code I posted earlier:
Code: [Select]
wpa_supplicant iwlan0 -c/home/wifi.cfg -Dwext -Bdirectly into terminal.

This gave me the following message:
Quote
successfully initialized wpa=supplicant
ioct1[SIOCSIWPMKSA] Operation Not Permitted
ioct1[WIOCSIWMODE] Operation not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
12=packet=init: socket(PF=PACKET) Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWENCODEEXT] Operation Not Permitted
ioct1[SIOCSIWAP] Operation Not Permitted
ioct1[SIOCSIWESSID] Operation Not Permitted
could not set interface wlan0 flags (DOWN): Operation Not Permitted
It's possible you may need to run that as root.

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #11 on: August 22, 2019, 10:30:11 PM »
Does that mean add sudo at the beginning?

If so, I tried that.  No errors this time, but no internet.  I'll have to try again when I'm less busy.  I read something about wicd ... I downloaded it, clicked on it, nothing happened.  Probably doing to uninstall it ...

When I have time, I'll come back and see if I can make progress.

Thank you so much for your help.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #12 on: August 22, 2019, 10:36:15 PM »
Hi kirin-rex
Are you sure  wifi.cfg   is in  /home  and not in  /home/tc ?

Offline kirin-rex

  • Newbie
  • *
  • Posts: 22
Re: bootlocal.sh permission denied
« Reply #13 on: October 08, 2019, 02:51:08 AM »
Okay!  Mission accomplished!

Finally had some time and came back to it.  I had to modify my code just a little to get it to work.  Here's what I eventually did (and I successfully got a second computer up and running on this method, so I feel fairly confident the results work now).

1.  Installed wpa=supplicant.tcz using a wired connection.

2.  I used terminal to enter the following codes

Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh

which allows me to save changes to bootlocal.sh

3.  added the following code to bootlocal.sh (in /opt/) and saved

Code: [Select]
sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10

Here I made two changes to the earlier code, deleting a space after "-i" and after "-t" in the third line.  That's where I think my code was going wrong.

3.  created a document in editor called wifi.cfg and saved it in the /home/tc/ folder.  In it is the following script

Code: [Select]
network={
scan_ssid=1
ssid="wifiname"
psk="password"
}

and substituted my actual wifiname and password.  I put the wifiname and password in quotations.

I not only got the first laptop running wifi, but successfully got a second wifi up and running in a few minutes.  Amazing how important a single space can be.

Rich, thank you for your help and patience.  I appreciate it a lot, and really honestly couldn't have done it without your help.  Thank you!  Thank you also to the other people who post in these forums, whose posts I read, and whose information led me to get wifi working on my ancient tiny-core laptops.

Thanks again!

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: bootlocal.sh permission denied
« Reply #14 on: October 08, 2019, 10:14:58 AM »
Hi kirin-rex
Just a few minor details:
... 2.  I used terminal to enter the following codes

Code: [Select]
sudo chown root:staff /opt/bootlocal.sh
sudo chown tc:staff /opt/bootlocal.sh
sudo chmod 775 /opt/bootlocal.sh

which allows me to save changes to bootlocal.sh ...
There's no need to execute that first line (sudo chown root:staff /opt/bootlocal.sh), the second 2 commands are sufficient.

Quote
3.  added the following code to bootlocal.sh (in /opt/) and saved

Code: [Select]
sudo if config wlan0 up
sudo wpa_supplicant -iwlan0 -c/home/tc/wifi.cfg -Dwext -B
sudo udhcpc -iwlan0 -t10

Here I made two changes to the earlier code, deleting a space after "-i" and after "-t" in the third line.  That's where I think my code was going wrong. ...
Commands in  bootlocal.sh  do not require  sudo.

The first line should be
Code: [Select]
ifconfig wlan0 upnot
Code: [Select]
if config wlan0 up
I don't think a space is required after "-i" and after "-t". If you look in  /etc/init.d/dhcp.sh  you'll see there is no space after the "-i".
The help flag also suggests it is not required. Run this:
Code: [Select]
udhcpc --help