×
INDI Library v1.8.1 Released (09 Sep 2019)

Monthly maintenance release INDI v1.8.1

vappasswd

6 months 3 days ago
kamisan
Expert Boarder
Expert Boarder
Posts: 94
More
Topic Author
vappasswd #37707
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.

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

6 months 3 days ago
Gonzothegreat
Administrator
Administrator
Posts: 1632
Karma: 6
More
vappasswd #37710
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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

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

6 months 3 days ago
kamisan
Expert Boarder
Expert Boarder
Posts: 94
More
Topic Author
vappasswd #37713
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!

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

6 months 3 days ago
Gonzothegreat
Administrator
Administrator
Posts: 1632
Karma: 6
More
vappasswd #37714
you can run :
stat /etc/hostapd/hostapd.conf
it will show you if the file has been modified really.

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

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

6 months 3 days ago
Gonzothegreat
Administrator
Administrator
Posts: 1632
Karma: 6
More
vappasswd #37716

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

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

5 months 1 week ago 5 months 1 week ago by geordan. Reason: Formatting
geordan
Fresh Boarder
Fresh Boarder
Posts: 1
More
vappasswd #38803
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

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

5 months 1 week ago
kamisan
Expert Boarder
Expert Boarder
Posts: 94
More
Topic Author
vappasswd #38806
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.

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

5 months 1 week ago
kamisan
Expert Boarder
Expert Boarder
Posts: 94
More
Topic Author
vappasswd #38808
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.

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

3 months 3 weeks ago
matsD8
Fresh Boarder
Fresh Boarder
Posts: 2
More
vappasswd #40358
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

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

3 months 3 weeks ago
kamisan
Expert Boarder
Expert Boarder
Posts: 94
More
Topic Author
vappasswd #40359
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?

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

3 months 3 weeks ago 3 months 3 weeks ago by matsD8.
matsD8
Fresh Boarder
Fresh Boarder
Posts: 2
More
vappasswd #40383
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

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

2 weeks 4 days ago 2 weeks 3 days ago by jhoney.
jhoney
Fresh Boarder
Fresh Boarder
Posts: 4
More
vappasswd #43974
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.
https://tutuapp.uno/ , https://9apps.ooo/ , https://showbox.kim/

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

Moderators: Kaczorek
Time to create page: 1.085 seconds