• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Forcing FOS to reboot from Remote (via ssh login)

Scheduled Pinned Locked Moved
Feature Request
4
8
2.6k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    TrialAndError
    last edited by Feb 4, 2017, 10:32 AM

    Hi,

    sometimes the image process stops (due to bad network connection?) but the FOS system is still working. In such situations rebooting the FOS system from remote (FOG management page or ssh login) would be very practical.

    For live systems like SystemRescueCD it is possible to set the root password and activate ssh by boot parameters. It would be perfect if such an functionality was implemented into FOG.

    Thank you for your work anyway.

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by Feb 4, 2017, 1:33 PM

      I think what you are asking for is two fold.

      1. If FOS had a watchdog service, in that if the process stops for more than XX minutes the FOS engine would issue an automatic reboot.

      2. This is a little known fact, but if you schedule a debug deploy/capture and then are dropped to the FOS command prompt. If you give root a password you can connect to the FOS engine via ssh. This function is a security feature to not allow remote connections unless the technician does these specific steps. But my point is FOS is fully capable to support what you want. While this (remote connection) won’t be allowed by the official release of fog (again for security reasons), you or whoever could create a custom init to define a password for root in FOS.

      Personally I like the watchdog function a bit more. But then if the process hangs, reboots, and hangs again I can see the system creating a boot loop to no end. Would it be more practical to just let the target computer freeze with the warning message?

      These are just my opinion and not official comments from the FOG project developers.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      W T 2 Replies Last reply Feb 4, 2017, 4:36 PM Reply Quote 0
      • W
        Wayne Workman @george1421
        last edited by Feb 4, 2017, 4:36 PM

        @george1421 said in Forcing FOS to reboot from Remote (via ssh login):

        you or whoever could create a custom init to define a password for root in FOS.

        Or set it up with MFA as well if you were that concerned about security. It’s relatively easy to tie Google-authenticator to ssh, lots of guides online about it.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        1 Reply Last reply Reply Quote 0
        • T
          TrialAndError @george1421
          last edited by Feb 4, 2017, 5:18 PM

          @george1421

          1. Automatic reboot would be perfectly enough for my purposes. To avoid boot loops there could be a counter on the server side perhaps?

          2. I am definitly no DAU but a custom init is far beyond my capabilities.

          (The time I would need to learn that would be more than I can save by not walking to the machine that hangs. 😉 )

          G 1 Reply Last reply Feb 4, 2017, 6:02 PM Reply Quote 0
          • G
            george1421 Moderator @TrialAndError
            last edited by george1421 Feb 4, 2017, 12:03 PM Feb 4, 2017, 6:02 PM

            @TrialAndError If you know a little about linux you know enough to modify the inits. I’m not saying you have to do this, just its possible.

            This wiki will allow you to access the contents of the inits (another name is the virtual hard drive) for FOS.

            https://wiki.fogproject.org/wiki/index.php?title=Modifying_the_Init_Image

            If I remember correctly there is in /bin or /usr/bin a bunch of bash shell scripts. They all start with “fog.”. The main bash script is called “fog”. In there if you added the code to give root a password it should enable the remote function you seek. Then just repack the inits give them a new name. Test the inits on one system if it does what you need then change the FOG global default for the inits to your new init. Don’t name it the same as an official fog release so an update won’t clobber your hacks.

            Know all you need to know is how to change the password in the fog bash script.
            ref: http://www.systutorials.com/39549/changing-linux-users-password-in-one-command-line/

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            1 Reply Last reply Reply Quote 0
            • T
              Tom Elliott
              last edited by Feb 4, 2017, 6:52 PM

              I can see the usecase for this and can actually add this functionality pretty easily. Of course, now with the postinit scripts you can include this yourself.

              The script to do this would be something like:

              #!/bin/bash
              echo -e "passwordhere\npasswordohere" | passwd
              

              Of course this would set the password to all FOS units to the same. You can add in alternate settings too.

              Using the kernel args per host, you could do something along the lines of:
              (Kernel Arg for example)
              hostpasswd='somepassword'
              Then the script could do something like:

              #!/bin/bash
              [[ -n $hostpasswd ]] && echo -e "${hostpasswd}\n${hostpasswd}" | passwd
              

              Hopefully this helps out.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              G T 2 Replies Last reply Feb 4, 2017, 6:57 PM Reply Quote 0
              • G
                george1421 Moderator @Tom Elliott
                last edited by Feb 4, 2017, 6:57 PM

                @Tom-Elliott Yep that’s a lot easier than tweaking the scripts. Well done!

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • T
                  TrialAndError @Tom Elliott
                  last edited by Feb 4, 2017, 9:58 PM

                  @Tom-Elliott
                  @george1421

                  Thank you for your answers.

                  I will give it a try next time I need some new challenge!

                  1 Reply Last reply Reply Quote 0
                  • P processor referenced this topic on Jun 6, 2024, 1:48 PM
                  • 1 / 1
                  1 / 1
                  • First post
                    2/8
                    Last post

                  204

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project