Well, let me tell ya buddy, it’s not as easy as pie (or cake). But don’t freak out, I got your back.
To start, what is a Nuke Password and why do we need one? A Nuke Password is essentially a password that will wipe out all data on your Kali Linux system if someone enters the wrong password too many times. This can be useful in situations where you have sensitive information or want to prevent unauthorized access to your machine.
Now, how do we add this magical Nuke Password? Well, it’s actually pretty simple (once you know what you’re doing). First, open up a terminal window and type:
# This script is used to add a Nuke Password to prevent unauthorized access to a machine.
# It opens a terminal window and uses the sudo command to gain root privileges.
# First, we use the sudo command to run the nano text editor with root privileges.
sudo nano /etc/lightdm/lightdm.conf
# The nano text editor allows us to make changes to the lightdm.conf file.
# This file is responsible for managing the login screen and user sessions.
# Once the file is open, we can add the Nuke Password by inserting the following line:
greeter-setup-script=/usr/bin/nuke-password
# This line tells the system to run the nuke-password script during the login process.
# The nuke-password script is responsible for prompting the user for a password and verifying it.
# After adding the line, we can save the changes and exit the nano text editor.
# Now, whenever someone tries to access the machine, they will be prompted for the Nuke Password.
# This adds an extra layer of security and prevents unauthorized access to the machine.
This will open up the lightdm configuration file in your default text editor (in this case, Nano).
Next, add the following line at the bottom of the file:
# This line is a comment, it is used to provide information about the code and is not executed by the computer.
# The following code will open the lightdm configuration file in the default text editor.
# In this case, the default text editor is Nano.
nano /etc/lightdm/lightdm.conf
# The following code adds a new line at the bottom of the file.
# This line enables the Nuke Password feature.
# It is important to add this line at the bottom of the file, as it will be read last and take effect.
# The [SeatDefaults] section specifies the default settings for the seat (user session).
# The greeter-session setting specifies the greeter (login screen) to use.
# In this case, we are using the lightdm-nukeshell greeter.
# Uncommenting this line means removing the "#" symbol at the beginning of the line, which makes the code active.
[SeatDefaults]
greeter-session=lightdm-nukeshell
Save and close the file. Now, let’s create our Nuke Password script by typing:
# This script creates a Nuke Password script by using the sudo command to open the nano text editor and create a file in the /usr/bin directory called lightdm-nukeshell.
# First, we use the sudo command to gain root privileges and access the /usr/bin directory.
sudo nano /usr/bin/lightdm-nukeshell
# Next, we use the nano text editor to create a new file called lightdm-nukeshell in the /usr/bin directory.
nano /usr/bin/lightdm-nukeshell
# We then use the sudo command again to ensure that we have the necessary permissions to save and modify the file.
sudo nano /usr/bin/lightdm-nukeshell
# Finally, we save and close the file by using the keyboard shortcut Ctrl+X and then pressing Y to confirm the changes.
# This completes the creation of our Nuke Password script.
This will open up a new text document in Nano. Copy and paste the following code into it:
#!/bin/bash
# This is a shebang line that specifies the interpreter to be used for the script, in this case, bash.
echo "Enter Nuke Password:"
# This line prints out a prompt for the user to enter their password.
read password
# This line reads the user's input and stores it in the variable "password".
if [ "$password" != "your_nuke_password_here" ]; then
# This line starts an if statement, checking if the user's input does not match the specified password.
echo "Incorrect password, system will now be wiped."
# If the condition is met, this line prints out a warning message.
rm -rf / && sync && reboot
# This line removes all files and directories in the root directory, syncs the changes to the disk, and reboots the system.
fi
# This line marks the end of the if statement.
Replace `your_nuke_password_here` with your desired Nuke Password. Save and close the file. Now, let’s make it executable by typing:
# This script is used to make the file "lightdm-nukeshell" executable
# by changing its permissions using the "chmod" command.
# The "sudo" command is used to run the following command as a superuser.
# The following command changes the permissions of the file "lightdm-nukeshell"
# to make it executable for all users.
sudo chmod +x /usr/bin/lightdm-nukeshell
That’s it! Your Kali Linux system now has a Nuke Password feature enabled. If someone enters an incorrect password too many times, your entire system will be wiped clean (including all data).
To avoid accidentally wiping out your system, make sure to choose a strong and unique Nuke Password that only you know. And remember, always backup important files before making any major changes to your system!