Configure Mideye MFA for Linux SSH & sudo via PAM RADIUS
This guide describes how to configure Linux SSH and sudo authentication to use Mideye Server for multi-factor authentication via the PAM RADIUS module (pam_radius_auth).
After completing the steps below, users connecting via SSH will be prompted for a second authentication factor through the Mideye Server.
| Component | Details |
|---|---|
| PAM module | pam_radius_auth (FreeRADIUS pam_radius) |
| Linux distributions | RHEL / CentOS / Rocky Linux / AlmaLinux (yum/dnf), Debian / Ubuntu (apt) |
| Mideye Server | 5.x / 6.x |
Prerequisites
Section titled “Prerequisites”- A running Mideye Server with RADIUS enabled (default UDP port 1812)
- The Linux server must be added as a RADIUS client in Mideye Server
- Root or sudo access on the Linux server
- Network connectivity from the Linux server to Mideye Server on UDP port 1812
- User accounts must exist in both the Linux server and the Mideye user repository (Active Directory, LDAP, or local database)
1. Install the PAM RADIUS module
Section titled “1. Install the PAM RADIUS module”Install the pam_radius package from the EPEL repository:
yum -y install epel-releaseyum -y install pam_radiusFor more information on the PAM RADIUS module, refer to the FreeRADIUS pam_radius GitHub repository and the USAGE documentation.
2. Configure pam_radius.conf
Section titled “2. Configure pam_radius.conf”Edit /etc/pam_radius.conf and add the Mideye Server connection details in the following format:
# server[:port] shared_secret timeout (s)10.10.20.30 supersecretsecret 35| Setting | Value |
|---|---|
| Server address | IP address of the Mideye Server |
| Shared secret | Must match the RADIUS client configuration in Mideye Server |
| Timeout | 35 seconds — required for MFA flows |
For full configuration options, see the pam_radius_auth.conf sample.
Save the changes.
3. Configure PAM for SSH
Section titled “3. Configure PAM for SSH”Edit /etc/pam.d/sshd and add the RADIUS authentication line after pam_sepermit.so:
auth sufficient pam_radius_auth.so client_id=LinuxPAMThe client_id parameter sets the NAS-Identifier sent to Mideye Server. This must match the NAS-ID configured in the Mideye RADIUS client.
Example /etc/pam.d/sshd configuration:
#%PAM-1.0auth required pam_sepermit.soauth sufficient pam_radius_auth.so client_id=LinuxPAMauth substack password-authauth include postloginFor more on the client_id and other parameters, see the pam_radius USAGE documentation.
Save the changes.
4. Enable Challenge-Response in SSH
Section titled “4. Enable Challenge-Response in SSH”Edit /etc/ssh/sshd_config and enable Challenge-Response authentication:
ChallengeResponseAuthentication yesIf the line exists with no, change it to yes. If it is commented out, uncomment and set to yes.
Save the changes.
5. Restart the SSH service
Section titled “5. Restart the SSH service”systemctl restart sshd6. Add Linux users
Section titled “6. Add Linux users”User accounts must exist on the Linux server, even though passwords are managed by Mideye Server (via Active Directory, LDAP, or local database).
For a user with LDAP username testuser@company.com, create a local account using just the username:
adduser testuserTroubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
| SSH times out before OTP entry | Verify timeout in /etc/pam_radius.conf is set to at least 35 seconds |
| Authentication fails immediately | Verify shared secret matches between /etc/pam_radius.conf and Mideye Server RADIUS client |
| No RADIUS logs in Mideye Server | Verify UDP port 1812 is open between the Linux server and Mideye Server |
| OTP prompt does not appear | Verify ChallengeResponseAuthentication yes is set in /etc/ssh/sshd_config and SSH is restarted |
| User not found | Verify the Linux user exists (id testuser) and the username matches the Mideye user repository |
client_id mismatch | Verify the NAS-ID in /etc/pam.d/sshd matches the NAS-ID in the Mideye RADIUS client configuration |
Related links
Section titled “Related links”Mideye documentation
Section titled “Mideye documentation”- RADIUS Clients — add the Linux server as a RADIUS client in Mideye Server
- RADIUS Integrations — authentication flows and supported auth types
- Authentication Types — all supported Mideye authentication methods
- RADIUS Timeout — how the timeout affects authentication
- Support Center — contact Mideye support for integration assistance
External documentation
Section titled “External documentation”- FreeRADIUS pam_radius GitHub repository — source code and documentation
- pam_radius USAGE documentation — all module parameters
- pam_radius_auth.conf sample — configuration file reference