shutdown

Franc
Franc Posts: 27  Freshman Member
First Comment Friend Collector First Anniversary
edited April 2021 in Security

Hi,

is there a way to shutting down the USG60 without doing the standard steps via browser (login>maintenance>reboot) ?

In event of electrical supply trouble I'd like to switch off the firewall very quickly to prevent hardware damages (I have already replaced TWO USG 100 for this reason!)

For example, it would be wonderful from my smarthphone have a special link to run directly the shutting down.

Any ideas or suggestion?


Thanks

Best regards

Accepted Solution

«1

All Replies

  • Franc
    Franc Posts: 27  Freshman Member
    First Comment Friend Collector First Anniversary
    edited November 2019

    Thank-you very much @mMontana @lalaland @Zyxel_Emily

    Best regards

  • PeterUK
    PeterUK Posts: 3,331  Guru Member
    100 Answers 2500 Comments Friend Collector Seventh Anniversary

    Maybe you should look at getting a UPS.

  • Franc
    Franc Posts: 27  Freshman Member
    First Comment Friend Collector First Anniversary

    I have the UPS of course.

    But the right question is why these pro devices don’t support an ups link!

    I am pretty angry because these firewalls are too delicate, just a few sudden stops to damage them.

  • mMontana
    mMontana Posts: 1,380  Guru Member
    50 Answers 1000 Comments Friend Collector Fifth Anniversary

    Scripting a terminal emulator? Never tried but could be possible.

  • lalaland
    lalaland Posts: 90  Ally Member
    First Answer First Comment Friend Collector Sixth Anniversary
    edited October 2019

    How about using python script to perform this task, and add it to windows scheduler run?

    Please don't run this script from wan since it is just simple telnet without encryption.

    (Replace them with your device ip, ID, and password.

    ----------------------------shutdown.py-------------------------------------

    import telnetlib

    #Log in info

    USG_IP = "192.168.2.1"

    ID = "admin"

    Password = "12345"

    tn = telnetlib.Telnet(USG_IP, timeout=1)

    #Set debug level if need

    #tn.set_debuglevel(2)

    #Telnet Log In

    tn.read_until("Username:")

    tn.write(ID + "\n")

    tn.read_until("Password:")

    tn.write(Password + "\n")

    #Put your command here

    tn.write("shutdown\n")

    tn.write("exit\n")

    #print

    print tn.read_all()

    --------------------------------------------------------------------------------

  • Franc
    Franc Posts: 27  Freshman Member
    First Comment Friend Collector First Anniversary
    edited November 2019

    Thank-You @lalaland and @mMontana ! It sounds very good and it may works also in a mobile app. It would be great to swith off the firewall from the smartphone.

    On USG 60 side, how can I enable the telnet script reception?

  • mMontana
    mMontana Posts: 1,380  Guru Member
    50 Answers 1000 Comments Friend Collector Fifth Anniversary

    Suggest SSH not Telnet outside LAN1.

  • lalaland
    lalaland Posts: 90  Ally Member
    First Answer First Comment Friend Collector Sixth Anniversary
    edited November 2019

    @Franc , Enable Telnet at "Configuration > System > Telnet"?

  • Franc
    Franc Posts: 27  Freshman Member
    First Comment Friend Collector First Anniversary

    thank-you very much guys I'll try and I let you know

  • Franc
    Franc Posts: 27  Freshman Member
    First Comment Friend Collector First Anniversary

    Hi @lalaland and @mMontana

    As you suggested I try with SSH, no third party client needed on MacOS.

    I successfully logged in via SSH and I simply wrote "shutdown". The USG immediately has switched off. Very good!!

    I wrote:

    "ssh username@host"

    "password"

    "shutdown"


    One more thing, is this way a RIGHT way to switch off the USG as the standard way via web interface? Or rather, does the USG switch off correctly without damages?


    Thank-you very much!

Security Highlight