Looking for a way to shutdown Firewalla GOLD in a remote power outage
As the title states I have a Firewalla Gold which is attached too a a PDU unit which is on a UPS, I have various equipment which is also attached too.
I have x2 HP Gen 8 Micro servers running Hyper V with various VM's, I have x2 Raspberry Pi's, A QNAP NAS and a couple of smart home hubs.
The Smart home hub has a power detection sensor attached so that if the device is on battery for 10 minutes then I will initiate a shutdown of above equipment, I have automated all of this and it seems to be working apart from on the Firewalla gold router.
For the raspberry pi's I am using the following command
"C:\Program files\puTTY\plink.exe" -batch -ssh 'username'@'hostname' -pw <Insert-Password-Here> sudo poweroff
It works for the raspberry pi's and I can get it to execute for the Firewalla gold but the problem comes after a certain time period passes I then get an access denied error, I am unable to log onto the Firewall with SSH or shut it down using the script until I then reset the SSH password, its like there is an expiry password set for the current password which is expiring after a period of time.
I am also very new to Linux\SSH so my knowledge in this area is quite basic, an idea I had was to maybe create another account that has sudo access that I can use to automate a shutdown if I need it.
-
Firewalla does reset the ssh password once a while. The best way is to use this to connect
https://www.ssh.com/ssh/copy-id
This will install your public key inside ssh, so it doesn't matter what the password is, you should be able to get in.
-
Thanks, have managed to get it working using PowerShell and windows in built SSH after a bit of research online. you need to run a couple of commands from power shell.
First run 'ssh-keygen' which will generate the public key in %userprofile%\.ssh
Then run the following to push the key to Firewalla:
'type C:\Users\<username>\.ssh\id_rsa.pub | ssh USERNAME@HOSTNAME 'cat >> .ssh/authorized_keys'' without the 'marks'
Once you do above enter the password for the Firewalla and then test you can access without a password by typing ssh username@hostname - Connection is made without the need for a password.
Thank you very much Firewalla for the guidance, now my gold can shutdown if there is ever a power outage!
Please sign in to leave a comment.
Comments
2 comments