takeover.sh is a free and open-source script with which you can remotely take over a running Linux system using SSH. It enables you to log into an in-memory rescue environment, unmount your root filesystem, etc. all without the need to reboot your laptop.
You can also replace your running distro with another one without touching a physical console. However, you will need to reboot your system. If you are interested, you can extend takeover.sh’s features to support re-executing a new init once you’re done so that you can switch to a new distro without rebooting. Hector Martin, the developer, is accepting pull requests.
takeover.sh was created for init systems that support reloading the init binary using the
telinit u command i.e. sysvinit and systemd. You would have to adapt it if you use a different system type but it still might not work.
Features of takeover.sh
- Free and open-source.
- Log into an in-memory rescue environment.
- Unmount your original root filesystem.
If anything goes wrong while you’re using the takeover script your computer system will panic.
- Do not use this script if you don’t understand exactly how it works.
- Do not use this script on any system you care about.
- Do not use this script on any system you expect to be up.
- Do not run this script unless you can afford to get physical access to fix a botched takeover.
Hector made it clear on GitHub that takover.sh is for Linux experts and he purposely left out steps from which you can copy and past commands.
In his own words:
This script does not have any provisions for exiting out of the new environment back into something sane. You will have to reboot when you’re done. If you get anything wrong, your machine won’t boot. Tough luck. This is not a guide for newbies. I’m deliberately not giving you commands you can copy and paste. If you can’t figure out what to do exactly without handholding, this script is not for you.
I haven’t included the usage details here because most readers wouldn’t need it. But if you are interested in using the script you can see the developer’s usage guide here.
You should try the script in a VM (Virtual Machine) where you can run a tarball of your live root filesystem for testing. Hector Martin wants setting up the boot loader to be an exercise for you.
What are your thoughts on takeover.sh? Will you be taking over any systems anytime soon? Is the script even useful to you in the first place? Share your ideas in the comments section below.