Changing the ssh password - C0ntr07/Firewalla-Information GitHub Wiki
This does not work. It appears that the "password" is maybe stored in redis.
Manually Setting the SSH Password
You can foolishly change the random password to anything you want. The password can be changed in the file ./.firewalla/.sshpasswd
. The file can be edited manually, or it can be change from the cli or in a script with sed
.
Using sed
and regex the password can be changed with:
sudo sed -i 's/\"password\"\: \".*\"\,/\"password\"\: \"NEWPASSWORD\"\,/g' /home/pi/.firewalla/.sshpasswd
sudo sed -i 's/\"password\"\: \".*\"\,/\"password\"\: \"NEWPASSWORD\"\,/g' /media/home-rw/overlay/pi/.firewalla/.sshpasswd
For example:
pi@firewalla:~$ sudo cat ./.firewalla/.sshpasswd
{
"password": "tNpZdVtyPy",
"timestamp": "2020-08-17T21:31:07.475Z"
}
pi@firewalla:~$ sudo sed -i 's/\"password\"\: \".*\"\,/\"password\"\: \"NEWPASSWORD\"\,/g' ./.firewalla/.sshpasswd
pi@firewalla:~$ sudo cat ./.firewalla/.sshpasswd
{
"password": "NEWPASSWORD",
"timestamp": "2020-08-17T21:31:07.475Z"
}
pi@firewalla:~$
How to use regex is out of scope of this article.