Change admin password from SSH session

Topics about the Software of Revolution Pi
Post Reply
jrbordelon
Posts: 5
Joined: 27 Dec 2024, 20:22

Change admin password from SSH session

Post by jrbordelon »

I'm in an SSH session with sudo privileges, and I want to change the admin password (for the web setup page) from the command line. Should I modify a file or execute a command?
User avatar
dirk
KUNBUS
Posts: 2214
Joined: 15 Dec 2016, 13:19

Re: Change admin password from SSH session

Post by dirk »

Hi jrbordelon, what hardware are you using? The problem disappears when you update to RevPi OS Bookworm. Only one account is used there, "pi". You can then change this using "passwd". Take a look at the documentation:
https://revolutionpi.com/documentation/ ... -the-image
jrbordelon
Posts: 5
Joined: 27 Dec 2024, 20:22

Re: Change admin password from SSH session

Post by jrbordelon »

I'm using RevPi connect with RO and AIO modules and I need to setup the module with the web page in https://deviceipaddress:41443/
User avatar
dirk
KUNBUS
Posts: 2214
Joined: 15 Dec 2016, 13:19

Re: Change admin password from SSH session

Post by dirk »

Okay jrbordelon, if you are still using WebStatus, simply click on the change password button before logging in. You can find out more about the web status here: https://revolutionpi.com/documentation/revpi-status/
jrbordelon
Posts: 5
Joined: 27 Dec 2024, 20:22

Re: Change admin password from SSH session

Post by jrbordelon »

To change the admin user's password from the web page, the previous password is required. How do you change the admin user's password from a terminal having root access to the device's Linux account?
User avatar
dirk
KUNBUS
Posts: 2214
Joined: 15 Dec 2016, 13:19

Re: Change admin password from SSH session

Post by dirk »

Hello jrbordelon, take a look here:
viewtopic.php?p=7859#p7859
but the location of the file "login.json" changed since then.
I'll do a test setup using the "2024-04-25-revpi-bullseye-armhf" image.
User avatar
dirk
KUNBUS
Posts: 2214
Joined: 15 Dec 2016, 13:19

Re: Change admin password from SSH session

Post by dirk »

Hello my friend, you can try to use these steps to create some script mechanism:

Code: Select all

cp /var/www/revpi/data/login.json ~
echo -n reovolutionpi | md5sum | cut -d ' ' -f 1
51390bd55a7fbb7f8c623b095f348e6e
sed -e 's/"ownPW":""/"ownPW":"51390bd55a7fbb7f8c623b095f348e6e"/g' ~/login.json > ~/newlogin.json
sudo cp ~/newlogin.json /var/www/revpi/data/login.json
Try to log in via password "reovolutionpi".

You can revert the defaults in case of a lock-out via

Code: Select all

cp ~/login.json cp /var/www/revpi/data/login.json
jrbordelon
Posts: 5
Joined: 27 Dec 2024, 20:22

Re: Change admin password from SSH session

Post by jrbordelon »

It worked perfectly, thank you very much.
Post Reply