How To Install molly-guard on Kali Linux

In this tutorial we learn how to install molly-guard on Kali Linux. molly-guard is protects machines from accidental shutdowns/reboots

Introduction

In this tutorial we learn how to install molly-guard on Kali Linux.

What is molly-guard

molly-guard is:

The package installs a shell script that overrides the existing shutdown/reboot/halt/poweroff/coldreboot/pm-hibernate/pm-suspend* commands and first runs a set of scripts, which all have to exit successfully, before molly-guard invokes the real command.

One of the scripts checks for existing SSH sessions. If any of the four commands are called interactively over an SSH session, the shell script prompts you to enter the name of the host you wish to shut down. This should adequately prevent you from accidental shutdowns and reboots.

molly-guard diverts the real binaries to /lib/molly-guard/. You can bypass molly-guard by running those binaries directly.

There are three methods to install molly-guard on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install molly-guard Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install molly-guard using apt-get by running the following command:

sudo apt-get -y install molly-guard

Install molly-guard Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install molly-guard using apt by running the following command:

sudo apt -y install molly-guard

Install molly-guard Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install molly-guard using aptitude by running the following command:

sudo aptitude -y install molly-guard

How To Uninstall molly-guard on Kali Linux

To uninstall only the molly-guard package we can use the following command:

sudo apt-get remove molly-guard

Uninstall molly-guard And Its Dependencies

To uninstall molly-guard and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove molly-guard

Remove molly-guard Configurations and Data

To remove molly-guard configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge molly-guard

Remove molly-guard configuration, data, and all of its dependencies

We can use the following command to remove molly-guard configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge molly-guard

Dependencies

molly-guard have the following dependencies:

References

Summary

In this tutorial we learn how to install molly-guard package on Kali Linux using different package management tools: apt, apt-get and aptitude.