How-To: Kali Linux 2021 Live USB with Persistence and Optional Encryption (Windows)

Shahzaib Chadhar
4 min readJul 16, 2021

In this article, I will show you how you can install Kali Linux Live USB 2021 with Persistence so, that you can save the data between reboots of PC/Laptop.

I will be using Windows OS and Rufus for the whole process to make it more simpler.

Requirements:

  1. 8GB USB/SSD/HDD

2. Kali Linux Live Image

1. Download Kali Linux Live

You can use this Link to download Kali Linux Live Image according to you hard ware configs. Like 64bit, 32bit.

2. Make USB Bootable/Write Kali ISO on USB/SSD/HDD

For this purpose you can use Rufus Tool.

Just download Rufus and run it.

  1. Select Device

If device not appeared just use the “Show Advanced drive properties” and will be selected.

2. Select ISO Image in the Boot selection.

3. Select the Persistent partition size.

If you have 8GB USB you can select 4GB otherwise any value you can set according to you SSD/HDD Capacity.

4. Click on START.

Next you will be getting few warning about writing the ISO on USB/SSD/HDD. Accept all these warning.

Click Yes
Click OK

After Few minutes (According to your PC and USB/SSD/HDD) Speed it will be ready for use.

Kali Linux 2021 Live Encryption

Now the actual work start. Just turn off/reboot your PC/Laptop after making bootable device.

When the Kali boot menu appear and select “Live USB Encrypted Persistence” and hit ENTER.

Wait for a while and Kali Linux will be opened.

Open the terminal and type these commands to config persistence encryption.

Super User:

$ sudo su

Verify your persistence partition by listing all

$ fdisk -l

Note: -l is lower case L not 1.

OUTPUT SEEMS LIKE THIS
Here is my Persistence Partition

Image above /dev/sda2 is my Persistence partition drive but your can be different so, be careful to identify your partition.

Tip: You can identify by check the space you specified on Rufus tool. Like in my case it’s 100GB.

Setup Disk Encryption

Using cryptsetup/luks

$ cryptsetup --verbose --verify-passphrase luksFormat /dev/sda2

Make sure you have used your own persistence partition like in my case it is sda2 and your can be different.

Type YES in capital letters.

You will be asked to enter the passphrase as a PASSWORD for partition and verify the passphrase.

You can set any that you can remember for future use. If every thing works fine you’ll be getting output like this:

LUKS Encryption has now been applied to your persistence partition.

Now open your encrypted persistence partition.

$ cryptsetup luksOpen /dev/sda2 my_usb

Enter the passphrase set in the previous step.

Create and Label Encrypted Filesystem

Use ext3 and label the partition as “persistence”.

$ mkfs.ext3 -L persistence /dev/mapper/my_usb

For Label:

$ e2label /dev/mapper/my_usb persistence

Mount, Unmount and Close Encrypted Partition

Use these commands:

$ mkdir -p /mnt/my_usb/
$ mount /dev/mapper/my_usb /mnt/my_usb
$ echo "/ union" > /mnt/my_usb/persistence.conf

Unmount:

$ umount /dev/mapper/my_usb

Now just close the partition using cryptsetup

$ cryptsetup luksClose /dev/mapper/my_usb

That’s All. Now your USB/SSD/HDD is ready for use as a persistence live Kali Linux.

Just you have to do is Reboot the machine and select Live USB Encrypted Persistence in the boot menu.

After you reboot your Laptop/PC, You will be asked for the passphrase that we have set in the whole process.

ALWAYS Choose the Live USB Encrypted Persistence from the Boot Menu.

Let know if you have any queries in the comments.

Also, Follow me on social sites Facebook, Twitter and YouTube.

--

--

Shahzaib Chadhar

I am Shahzaib Chadhar, a hard-working, reliable freelance Full Stack Developer and Data Extraction Specialist.