Page 1 of 1
Change admin password from SSH session
Posted: 30 Dec 2024, 23:11
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?
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 11:09
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
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 13:32
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/
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 14:14
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/
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 15:33
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?
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 16:10
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.
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 17:14
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
Re: Change admin password from SSH session
Posted: 02 Jan 2025, 19:58
by jrbordelon
It worked perfectly, thank you very much.