Two-Factor Authentication (2FA/MFA) for Linux SSH
Linux 2FA SSH module provides a secure way to login into the linux desktop logins, remote or local linux SSH servers that enhance the
security and makes the brute force attacks more difficult. Two-factor Authentication for SSH adds an extra layer of security to increase the identity assurance and reduce risk and exposure. The users will use their existing credentials
(username and password) as their first factor and then they will be prompted for entering the configured second factor type. miniOrange can connect to the on-premise AD (Active Directory) so that user will use their AD credentials to authenticate themselves. miniOrange Two Factor Authentication (2FA)
module can be installed on Linux operating systems to add Two-Factor or Multi-Factor authentication on the top of local and Remote login.
Be Cyber Insurance compliant with miniOrange MFA solution. Read More
Get Free Installation Help -Book a Slot
miniOrange offers free help through a consultation call with our System Engineers to Install or Setup linux MFA / 2FA (Two-Factor Authentication) solution in your environment with 30 days Free trial.
For this, you need to just send us an email at idpsupport@xecurify.com to book a slot and we'll help you setting it up in no time.
Step by step guide to enable Linux MFA / 2FA (Two/Multi Factor Authentication)
1. Adding app and policy for 2FA
- Login into miniOrange Admin Console.
- Go to Apps. Click on Add Application button.

- In Choose Application Type select Desktop from All Apps dropdown.

- Click on Linux/Unix.

- In the Basic tab, enter the following details:
| Basic Tabs |
Description |
| Display Name |
Enter the Display Name (i.e., the name for this application). |
| Description (Optional) |
Add a description if required. |
| App Secret |
You can find App Secret by clicking the icon as shown below. |

- Click on Save to continue. You will be automatically redirected to the Policies section. Click on Add Policy.

- A dialog box will appear prompting you to enter the following details:
| Group Name |
Select the group for which you wish to add this policy. For multiple groups, you can click here to add a multiple/separate policies for each group. |
| Policy Name |
You can give a name for the authentication policy. |
| First Factor |
Select the login method as Password and Password-less. You can enable 2-Factor Authentication (MFA), Adaptive Authentication and Force MFA On Each Login Attempt if required. |

- Click on Submit to add the policy.
1.2. Select 2FA options
- Go to 2-Factor Authentication >> Choose 2FA Options for End User.
- Disable the methods you don’t want your users to configure or use for MFA

Note: Currently miniOrange only supports TOTP Methods (OTP OVER SMS, OTP OVER EMAIL, GOOGLE AUTHENTICATOR, MICROSOFT AUTHENTICATOR, AUTHY AUTHENTICATOR, YubiKey HARDWARE TOKEN ) for linux MFA.
2. Setup miniOrange 2FA/MFA Provider for SFTP/SSH
- Download the miniOrange MFA RPM package here.
- Give the execute permissions the downloaded RPM file via running below command in the terminal:
chmod a+x miniorange-mfa.rpm

- Run the following command to install the miniOrange MFA RPM package:
sudo rpm -ivh miniorange-mfa.rpm

| Option |
Description |
| --install |
Install the miniOrange MFA |
| --uninstall |
Remove the miniOrange MFA |
| --enable <sshd|sudo|su|login> |
Enable miniOrange mfa for specified service |
| --disable <sshd|sudo|su|login> |
Disable miniOrange mfa for specified service |
| -e |
Edit the miniOrange configuration file |
| -d |
Display the miniOrange configuration file |
| --enable-pl <sshd|sudo|su|login> |
Enable Passwordless Authentication for specified service |
| --disable-pl <sshd|sudo|su|login> |
Disable Passwordless Authentication for specified service |
| --check |
Run troubleshooting checks for the miniOrange MFA setup |
| --test <login|sshd|sudo> <username> |
Test miniOrange MFA for the specified service (login, sshd, or sudo) for the given username |
| --enable_selinux |
Allow miniOrange MFA in SELinux Policy |
- Run below command for 2FA configuration in the terminal as root user
sudo miniorange-mfa --install

- You will be asked for some configuration details. To fill in these details, login to your miniOrange admin account on Cloud or Onpremise.
- Click on the Settings icon on top right corner.

- Copy the Customer Key and API key.

- Now, Go to Apps and copy the name of the Linux application created in step 1.

- Paste all these details in the terminal and press enter.

- You will be asked to enable the MFA on SSH login. If you want to enable the MFA on SSH login then type ‘y’ and hit enter.

- Download the miniOrange MFA DEB package here.
- Give the execute permissions the downloaded DEB file via running below command in the terminal:
chmod a+x miniorange-mfa.deb

- Run the following command to install the miniOrange MFA DEB package:
sudo dpkg -i miniorange-mfa.deb

| Option |
Description |
| --install |
Install the miniOrange MFA |
| --uninstall |
Remove the miniOrange MFA |
| --enable_ssh |
Enable miniOrange mfa for SSH Login |
| --disable_ssh |
Disable miniOrange mfa for SSH Login |
| -e |
Edit the miniOrange configuration file |
| -d |
Display the miniOrange configuration file |
| --enable-pl |
Enable Passwordless Authentication |
| --disable-pl |
Disable Passwordless Authentication |
| --check |
Run troubleshooting checks for the miniOrange MFA setup |
| --test <login|sshd|sudo> <username> |
Test miniOrange MFA for the SSH Login (login, sshd, or sudo) for the given username |
- Run below command for 2FA configuration in the terminal as root user
sudo miniorange-mfa --install

- You will be asked for some configuration details. To fill in these details, login to your miniOrange admin account on Cloud or Onpremise.
- Click on the Settings icon on top right corner.

- Copy the Customer Key and API key.

- Now, Go to Apps and copy the name of the Linux application created in step 1.

- Paste all these details in the terminal and press enter.

- You will be asked to enable the MFA on SSH login. If you want to enable the MFA on SSH login then type 'y' and hit enter.

3. Testing MFA Configuration
- MFA will be asked after successful password authentication.

- If you encounter issues while testing the MFA, use the command below to troubleshoot:
miniorange-mfa --check

To access the manual for miniOrange MFA commands, use the command: man miniorange-mfa
4. Configure Your User Directory (Optional)
miniOrange provides user authentication from various external sources, which can be Directories (like ADFS, Microsoft Active Directory, Microsoft Entra ID, OpenLDAP, Google, AWS Cognito etc), Identity Providers (like Okta, Shibboleth, Ping, OneLogin, KeyCloak), Databases (like MySQL, Maria DB, PostgreSQL) and many more. You can configure your existing directory/user store or add users in miniOrange.
- Click on Identity Providers >> Add Identity Provider in the left menu of the dashboard

- In Choose Identity Provider, select AD/LDAP Directories from the dropdown.

- Then search for AD/LDAP and click it.

- STORE LDAP CONFIGURATION IN MINIORANGE: Choose this option if you want to keep your configuration in miniOrange. If the active directory is behind a firewall, you will need to open the firewall to allow incoming requests to your AD.
- STORE LDAP CONFIGURATION ON PREMISE: Choose this option if you want to keep your configuration in your premise and only allow access to AD inside premises. You will have to download and install miniOrange gateway on your premise.

- Enter AD/LDAP Display Name and Identifier name.
- Select Directory Type as Active Directory.
- Enter the LDAP Server URL or IP Address against the LDAP Server URL field.
- Click on the Test Connection button to verify if you have made a successful connection with your LDAP server.

- In Active Directory, go to the properties of user containers/OU's and search for the Distinguished Name attribute. The bind account should have minimum required read privileges in Active Directory to allow directory lookups. If the use case involves provisioning (such as creating, updating, or deleting users or groups), the account must also be granted appropriate write permissions.

- Enter the valid Bind account Password.
- Click on the Test Bind Account Credentials button to verify your LDAP Bind credentials for LDAP connection.

- Search Base is the location in the directory where the search for a user begins. You will get this from the same place you got your Distinguished name.

- Select a suitable Search filter from the drop-down menu. If you use User in Single Group Filter or User in Multiple Group Filter, replace the <group-dn> in the search filter with the distinguished name of the group in which your users are present. To use custom Search Filter select "Write your Custom Filter" option and customize it accordingly.

- Click on the Next button, or go to the Login Options tab.
- You can also configure following options while setting up AD. Enable Activate LDAP in order to authenticate users from AD/LDAP. Click on the Next button to add user store.

Here's the list of the attributes and what it does when we enable it. You can enable/disable accordingly.
| Attribute |
Description |
| Activate LDAP |
All user authentications will be done with LDAP credentials if you Activate it |
| Fallback Authentication |
If LDAP credentials fail then user will be authenticated through miniOrange |
| Enable administrator login |
On enabling this, your miniOrange Administrator login authenticates using your LDAP server |
| Show IdP to users |
If you enable this option, this IdP will be visible to users |
| Sync users in miniOrange |
Users will be created in miniOrange after authentication with LDAP |
- Click on the Next button, or go to the Attributes tab.
Attributes Mapping from AD
User Import and Provisioning from AD
- If you want to set up provisioning, click here for detailed information. We will skip this step for now.

Test Connections
- You will see a list of directories under Identity Providers. From the dropdown, select AD/LDAP Directories, search for your configured directory, click the three dots next to it, and select Test Connection.

- A pop-up appears prompting you to enter a username and password to verify your LDAP configuration.

- On Successful connection with LDAP Server, a success message is shown.

Test Attribute Mapping
- You will see a list of directories under Identity Providers. From the dropdown, select AD/LDAP Directories, search for your configured directory, click the three dots next to it, and select Test Attribute Mapping.

- A pop‑up appears to enter a username and click Test.

- The Test Attribute Mapping Result will be displayed.

Set up AD as External Directory configuration is complete.
Note: Refer our guide to setup LDAP on windows server.
miniOrange integrates with various external user sources such as directories, identity providers, and etc.
Further References