Command Line Interface (CLI) for Hasleo BitLocker Anywhere For Linux.

Hasleo BitLocker Anywhere For Linux has a command line interface (CLI) for users to perform operations without actually launching the graphical user interface (GUI), it allows you to issue commands from the Terminal or through the use of scripts.

Notes: Please note that Command Line Interface (CLI) is not available in the Professional Edition, please contact us to purchase the edition that supports CLI.

Download BitLocker For Windows Download BitLocker For Mac Download BitLocker For Linux

Tutorial to run command line interface (CLI) for BitLocker Anywhere For Linux.

Step 1. Open Terminal and switch to root user.

Step 2. Navigate to the folder where BitLockerAnywhereCmd is located by typing in:
cd /home/jason/bitlocker-anywhere/bin
Tips Tips: If you extracted the program in a different location, enter that location instead.

Step 3. Type "./BitLockerAnywhereCmd /?" for help, all the command and parameters of this tool will be listed as below:

Hasleo BitLocker Anywhere Command Line Tool [Version 9.3 (Build: Nov 23 2023)]
Copyright (C) 2023 Hasleo Software. All rights reserved.

/a <action> Specifies the action (activate/drives/encrypt/decrypt/lock/unlock) you want to perform.
activate: Activate the license key
drives: Lists drives
encrypt: encrypts the specified drive
decrypt: decrypts the specified drive
lock: lock the specified drive
unlock: unlock the specified drive
/? Produce a help message.

Options for 'activate' action: (The machine code will be displayed if no options are specified.)
/n <key> Specifies the license key.
/c <code> Specifies the offline activation code.
/? Produce a help message.

Options for 'drives' action:
/? Produce a help message.

Options for 'encrypt' action:
/n <name> Specifies the name of the drive that you want to encrypt. You can perform
the 'drives' operation to view the name of all drives.
/p <password> Specifies the password used to encrypt the drive.
/u <used> (Optional) Specifies whether to encrypt the used disk space only, it
defaults to 0 if not provided.
0: No
1: Yes
/c <compatible> (Optional) Specifies whether to encrypt the drive using compatibility mode,
it defaults to 0 if not provided.
0: No
1: Yes
/s <strength> (Optional) Specifies whether to encrypt the drive using 256-bit encryption
strength, it defaults to 0 if not provided.
0: No
1: Yes
/r <recovery> (Optional) Specifies the path to save the BitLocker recovery key.
/i <silent> (Optional) Specifies the silent mode, it defaults to 0 if not provided.
0: Non-silent mode
1: Silent mode
/? Produce a help message.

Options for 'decrypt' action:
/n <name> Specifies the name of the drive that you want to decrypt. You can perform
the 'drives' operation to view the name of all drives.
/p <password> (Optional) Specifies the password used to decrypt the drive. You cannot
specify /p and /r at the same time.
/r <recovery> (Optional) Specifies the BitLocker recovery key used to decrypt the drive.
You cannot specify /p and /r at the same time.
/u <used> (Optional) Specifies whether to decrypt the used disk space only, it
defaults to 1 if not provided.
0: No
1: Yes
/i <silent> (Optional) Specifies the silent mode, it defaults to 0 if not provided.
0: Non-silent mode
1: Silent mode
/? Produce a help message.

Options for 'lock' action:
/n <name> Specifies the name of the drive that you want to lock. You can perform the
'drives' operation to view the name of all drives.
/s <silent> (Optional) Specifies the silent mode, it defaults to 0 if not provided.
0: Non-silent mode
1: Silent mode
/? Produce a help message.

Options for 'unlock' action:
/n <name> Specifies the name of the drive that you want to unlock. You can perform
the 'drives' operation to view the name of all drives.
/p <password> (Optional) Specifies the password used to unlock the drive. You cannot
specify /p and /r at the same time.
/r <recovery> (Optional) Specifies the BitLocker recovery key used to unlock the drive.
You cannot specify /p and /r at the same time.
/? Produce a help message.

Examples:
BitLockerAnywhereCmd /a drives
BitLockerAnywhereCmd /a encrypt /n /dev/sdb1 /p 12345678 /u 1 /c 1 /s 1 /r /home/jason/keys /i 1

Command line interface for BitLocker in Linux

 

As you can see from the above, you can use the command-line interface provided by the Hasleo BitLocker Anywhere to encrypt drives with BitLocker, decrypt, lock and unlock BitLocker encrypted drives from the Terminal or scripts in linux.

 

Frequently Asked Questions (FAQ) for BitLocker Command Line Interface in Linux

Q: What is the command-line interface for BitLocker in Linux?

A: Hasleo BitLocker Anywhere For Linux provides a command-line interface (CLI) that allows you to encrypt, decrypt, lock, and unlock BitLocker encrypted drives from the Terminal or scripts in Linux without launching the GUI.

Q: What actions can be performed using the CLI in Linux?

A: Using the CLI, you can perform actions including: activate (license activation), drives (list drives), encrypt (encrypt drive), decrypt (decrypt drive), lock (lock drive), and unlock (unlock drive).

Q: How do I get help with the CLI commands?

A: Type "./BitLockerAnywhereCmd /?" in the Terminal to see all available commands and parameters for the BitLocker Anywhere command-line tool.

Q: Can I use scripts with the BitLocker CLI in Linux?

A: Yes, the CLI allows you to automate BitLocker operations through scripts, making it ideal for batch processing and enterprise deployment.

Q: How do I encrypt a drive using the CLI in Linux?

A: Use the command: ./BitLockerAnywhereCmd /a encrypt /n /dev/sdb1 /p 12345678 /u 1 /c 1 /s 1 /r /home/user/keys /i 1, where /n specifies the drive, /p is the password, and other options control encryption mode.

Q: What is the silent mode option in CLI?

A: The /i parameter specifies silent mode: 0 for non-silent mode (shows GUI), 1 for silent mode (runs without user interaction). This is useful for scripted operations.

Q: How do I list all drives using the CLI?

A: Run the command: ./BitLockerAnywhereCmd /a drives to list all available drives on the system.