×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

vappasswd

  • Posts: 112
  • Thank you received: 9

vappasswd was created by kamisan

I am trying to thwart my nosy neightbors from gaining access to my Astoberry and wreaking havoc.

I searched the forum for discussions related to changing the password of the VAP. Nothing tangible but I did find a section of the README file at Astroberry's Github repo that looked promising: vappasswd. Here is how I proceeded:

>sudo vappasswd
>Enter user password: astroberry
>Enter new VAP password: nonosyneighbors
>Confirm password: nonosyneighbors
>Password changed!
>You must reboot

After rebooting, when I go to connect to VAP it rejects 'nonosyneighbors' but still accepts 'astroberry'. It's as if my effort was wasted.

I am sure I am doing something stupid.

Thanks.
5 years 6 days ago #37707

Please Log in or Create an account to join the conversation.

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic vappasswd

I can't help you as to why it's not working, but having just looked at the code for vappasswd I must say that any modifications of a config files should have a proper change control.
This is to allow reverting back quickly to the last good known version.

so something like as an example:
if [ -f /etc/hostapd/hostapd.conf ]; then
    OLDPSK=$(grep wpa_passphrase /etc/hostapd/hostapd.conf|awk -F= '{print $2}')
    if [ -z "$OLDPSK" ]; then
       echo "Error changing Virtual Access Point password!"
       exit 1
    else
       cp  /etc/hostapd/hostapd.conf{,"_$(date +"%d-%m-%y_%H-%M-%S")"}
       sed -i -e "s/wpa_passphrase=$OLDPSK/wpa_passphrase=$NEWPSK/g" /etc/hostapd/hostapd.conf
       echo "Virtual Access Point password changed successfully. You need to reboot to activate changes."
       exit 0
    fi
5 years 6 days ago #37710

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 9

Replied by kamisan on topic vappasswd

That is the message I got:

echo "Virtual Access Point password changed successfully. You need to reboot to activate changes."

I will take a look to see what changes, if any, were made to:

/etc/hostapd/hostapd.conf

Thanks!
5 years 6 days ago #37713

Please Log in or Create an account to join the conversation.

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic vappasswd

you can run :
stat /etc/hostapd/hostapd.conf
it will show you if the file has been modified really.
5 years 6 days ago #37714

Please Log in or Create an account to join the conversation.

  • Posts: 2255
  • Thank you received: 223
5 years 6 days ago #37716

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 1

Replied by Geordan on topic vappasswd

Do you have a 3B or 3B+? There are different hostapd.conf files for different RPi revisions, and vappasswd currently doesn't update them all correctly. I've submitted a pull request to address this issue; you can take those files and drop them into /usr/local/bin, and then vappasswd should work.
The following user(s) said Thank You: kamisan
Last edit: 4 years 11 months ago by Geordan. Reason: Formatting
4 years 11 months ago #38803

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 9

Replied by kamisan on topic vappasswd

Thanks geordan, I'll give that a try. It's funny I was just talking highly of Astroberry/INDI/Ekos to some new friends at an Astronomy club. It's good KARMA methinks.
4 years 11 months ago #38806

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 9

Replied by kamisan on topic vappasswd

Hi geordan,

I have a Model 3B. I looked at your changes at GitHub so as to understand. I decided to make just the essential changes to the three lines in vappasswd and vaprename from "/etc/hostapd/hostapd.conf" to "/etc/hostapd/hostapd_3b.conf" It works perfectly!

One thing to be aware of though, there is odd behavior when using an '=' equal sign in the password. For example if I run vappasswd to change the password to 'pi=' and then look what it wrote, it says: 'wpa_passphrase=pi='. Then if I run vappasswd and change it to 'foo' then it says: 'wpa_passphrase=foo='. In order to remove the equal sign I had to edit hostapd_3b.conf.

Thanks very much. This is perfect timing. I am going mobile to a star party in a few weeks and I was concerned that someone else might be running Astroberry.
4 years 11 months ago #38808

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0

Replied by Matthias Kraft on topic vappasswd

Hallo kamisan,
sorry, I do not understand your information well:
>> I decided to make just the essential changes to the three lines in vappasswd and vaprename from "/etc/hostapd/hostapd.conf" to "/etc/hostapd/hostapd_3b.conf" It works perfectly!
Whow did you make it ????

All time I try to modify the password of Virtual Access Point of AstroBerry I can NOT find its network anymore....
I see that sudo vappasswd and sudo vaprename change the files "/etc/hostapd/hostapd.conf" and "/etc/hostapd/hostapd_3bplus.conf" and "/etc/hostapd/hostapd_3b.conf"
But after sudo reboot the VAP seems not work anymore. I can not find the WLAN at mobile-phone...
Same happens, when I try to change these file manually ba sudo nano <filename> at line ssid=xxxxxx and wpa_passphrase=xxxxxx
Does not matter, if I change hw_mode to g and channel to 6 or not ....

I do not find out where I make mistake(s).
Perhaps you can explain step by step what you did to change passwort (anns ssid) of VAP succesfully.
Thanks
Mats
4 years 9 months ago #40358

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 9

Replied by kamisan on topic vappasswd

Hi Mats,

To be honest I do not use vappasswd and vaprename anymore. Now I directly edit /etc/hostapd/hostapd_3bplus.conf.

It looks to me like you did everything correctly. I use hw_mode=g, channel=6. I connect to RasPi using Linux laptop Ubuntu 16.04. I have not tested it with a mobile phone.

Perhaps you can try connecting with your laptop over WiFi?
4 years 9 months ago #40359

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0

Replied by Matthias Kraft on topic vappasswd

S O L V E D :-)

Hello,
thanks to kamisan for his hint!

NOW I can change ssid and password of astroberrys Virtual Access Point (rpi VAP) at RPI 3+ B+ this way:
- Write astroberry-image to sd-card
- put sd-card into raspberry pi 3+ B+
- power ON raspberry
- Now I can FIND WLAN-network with ssid=astroberry with other devices (smartphone, windows10-laptop).
- LOGIN at rpi VAP with its standard-password=astroberry (OR connet witl LAN-cable)
-start PUTTY on Windows10-PC (OR connect to VAP astroberry and use MATE TERMINAL at raspberry, OR any other terminal)
- sudo nano /etc/hostapd/hostapd_3bplus.conf to change ONLY THIS FILE !!!
- In /etc/hostapd/hostapd_3bplus.conf change ssid=astroberrytest, wpa_passphrase=TestTest1234 (REMEMBER: password MUST be complex!!! At least 8 signs!!!)
- save file in nano with ctrl-o and exit with ctrl-x
- sudo reboot
(- It may help to delete "known WLANs" at Windows10-laptop or android-smartphone)

After that, the rpi VAC with new ssid is found/visible ap PC ans smartphone and I can login with new password :-)
Thanks for help and best regards
mats
Last edit: 4 years 9 months ago by Matthias Kraft.
4 years 9 months ago #40383

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0

Replied by snow jhon on topic vappasswd

Do you have a 3B or 3B+? There are different hostapd.conf files for different RPi revisions, and vappasswd currently doesn't update them all correctly. I've submitted a pull request to address this issue; you can take those files and drop them into /usr/local/bin, and then vappasswd should work.
tutuapp.uno/ , 9apps.ooo/ , showbox.kim/
Last edit: 4 years 6 months ago by snow jhon.
4 years 6 months ago #43974

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 1.165 seconds